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

Last change on this file since 4786 was 4786, checked in by Pascal Terjan, 8 years ago

Add set_cursor to the ruby binding (patch from Tony Miller <mcfiredrill@gmail.com>)

File size: 1.1 KB
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
30    def test_set_cursor
31        d = Caca::Display.new()
32        d.cursor = 1
33    end
34end
Note: See TracBrowser for help on using the repository browser.