source: libcaca/trunk/ruby/t/tc_display.rb @ 2822

Last change on this file since 2822 was 2822, checked in by Sam Hocevar, 13 years ago

Continuing the libcucul-libcaca merge.

File size: 994 bytes
Line 
1require 'test/unit'
2require 'caca'
3
4class TC_Canvas < Test::Unit::TestCase
5    def test_create
6        d = Caca::Display.new
7        assert_not_nil(d, 'Display creation failed')
8    end
9    def test_create_with_driver
10        d = Caca::Display.new(Caca::Display.driver_list[0])
11        assert_not_nil(d, 'Display creation failed')
12    end
13    def test_create_wrong_args
14        assert_raise(RuntimeError){Caca::Display.new("plop")}
15        driver = Caca::Display.driver_list[0]
16        assert_raise(ArgumentError){Caca::Display.new(driver, driver)}
17        c = Caca::Canvas.new(3, 3)
18        assert_raise(ArgumentError){Caca::Display.new(c, c)}
19    end
20    def test_create_from_canvas
21        c = Caca::Canvas.new(3, 3)
22        d = Caca::Display.new(c)
23        assert_not_nil(d, 'Display creation failed')
24        assert_equal(d.canvas, c, 'Wrong canvas')
25    end
26    def test_set_title
27        c = Caca::Canvas.new(3, 3)
28        d = Caca::Display.new(c)
29        d.title = "Test !"
30    end
31end
Note: See TracBrowser for help on using the repository browser.