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

Last change on this file since 3483 was 3483, checked in by Sam Hocevar, 10 years ago

Fix a ruby unit test that made wrong use of Caca::Display.driver_list.

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