diff options
Diffstat (limited to 'test.rb')
-rwxr-xr-x | test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -32,6 +32,17 @@ class MahoroTestCase < Test::Unit::TestCase @m.buffer(File.read('mahoro.c'))) end + def test_buffer_string_convert + tmp = File.read('mahoro.c') + buf = Struct.new(:to_str).new(tmp) + assert_equal('ASCII C program text', @m.buffer(buf)) + end + + def test_buffer_invalid + @m.flags = Mahoro::NONE + assert_raises(TypeError) { @m.buffer @m } + end + def test_mime_buffer @m.flags = Mahoro::MIME assert({ |