about summary refs log tree commit homepage
path: root/test.rb
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2013-04-05 06:25:43 +0000
committerEric Wong <normalperson@yhbt.net>2013-04-05 06:25:43 +0000
commitbefa6dade6158a86be88c7580a6259059e20fb25 (patch)
treeda8b451d72196c63a0409dcbab4fe4f6db2dbcbd /test.rb
parentf5774348b6fe5bb7e86717629fdb8c4d8c30731f (diff)
downloadmahoro-befa6dade6158a86be88c7580a6259059e20fb25.tar.gz
Mahoro#file supports objects with #to_path support
Pathname (and some other classes) are implemented this way and
Ruby 1.9+ respects #to_path on all File.open calls.
Diffstat (limited to 'test.rb')
-rwxr-xr-xtest.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test.rb b/test.rb
index fe00b36..75e46d6 100755
--- a/test.rb
+++ b/test.rb
@@ -2,6 +2,7 @@
 
 require 'test/unit'
 require 'mahoro'
+require 'pathname'
 
 class MahoroTestCase < Test::Unit::TestCase
 
@@ -19,6 +20,12 @@ class MahoroTestCase < Test::Unit::TestCase
                 assert_match(/(?:source|text)/, buf, "is source or text")
         end
 
+        def test_pathname
+                @m.flags = Mahoro::NONE
+                pn = Pathname.new('mahoro.c')
+                assert_c_text(@m.file(pn))
+        end
+
         def test_file
                 @m.flags = Mahoro::NONE
                 assert_c_text(@m.file('mahoro.c'))