source: libcaca/trunk/ruby/t/tc_canvas.rb @ 1965

Last change on this file since 1965 was 1965, checked in by Pascal Terjan, 13 years ago
  • Add more tests for the ruby binding
File size: 799 bytes
Line 
1require 'test/unit'
2require 'cucul'
3
4class TC_Canvas < Test::Unit::TestCase
5    def setup
6        @c = Cucul::Canvas.new(3, 3)
7    end
8    def test_create
9        c = Cucul::Canvas.new(3, 3)
10        assert(c, 'Canvas creation failed')
11        assert(c.width == 3 && c.height == 3, 'Wrong size for new canvas')
12    end
13    def test_width
14    @c.width=42
15        assert_equal(c.width, 42, 'Failed to set width')
16    end
17    def test_height
18        @c.height=42
19        assert_equal(c.height, 42, 'Failed to set width')
20    end
21    def test_size
22    @c.set_size(100,100)
23        assert(@c.width == 100 && @c.height == 100, 'Failed to set size')
24    end
25    def test_import
26        @c.import_memory("foo", "")
27        assert_equal(@c.export_memory("irc"), "foo\r\n", "Import/Export failed")
28    end
29end
Note: See TracBrowser for help on using the repository browser.