ソースを参照

* Add more tests for the ruby binding

tags/v0.99.beta14
Pascal Terjan pterjan 17年前
コミット
4db01daeec
2個のファイルの変更31行の追加0行の削除
  1. +29
    -0
      ruby/t/tc_canvas.rb
  2. +2
    -0
      ruby/test

+ 29
- 0
ruby/t/tc_canvas.rb ファイルの表示

@@ -0,0 +1,29 @@
require 'test/unit'
require 'cucul'

class TC_Canvas < Test::Unit::TestCase
def setup
@c = Cucul::Canvas.new(3, 3)
end
def test_create
c = Cucul::Canvas.new(3, 3)
assert(c, 'Canvas creation failed')
assert(c.width == 3 && c.height == 3, 'Wrong size for new canvas')
end
def test_width
@c.width=42
assert_equal(c.width, 42, 'Failed to set width')
end
def test_height
@c.height=42
assert_equal(c.height, 42, 'Failed to set width')
end
def test_size
@c.set_size(100,100)
assert(@c.width == 100 && @c.height == 100, 'Failed to set size')
end
def test_import
@c.import_memory("foo", "")
assert_equal(@c.export_memory("irc"), "foo\r\n", "Import/Export failed")
end
end

+ 2
- 0
ruby/test ファイルの表示

@@ -4,3 +4,5 @@ require 'test/unit'
Dir.glob("t/tc*.rb").each{ |t|
require t
}

exit Test::Unit::AutoRunner.run

読み込み中…
キャンセル
保存