about summary refs log tree commit homepage
path: root/test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test.rb')
-rwxr-xr-xtest.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/test.rb b/test.rb
index 1ffb570..52b3b80 100755
--- a/test.rb
+++ b/test.rb
@@ -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({