You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

tc_display.rb 995 B

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