diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-04-05 06:25:43 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-04-05 06:25:43 +0000 |
commit | befa6dade6158a86be88c7580a6259059e20fb25 (patch) | |
tree | da8b451d72196c63a0409dcbab4fe4f6db2dbcbd /test.rb | |
parent | f5774348b6fe5bb7e86717629fdb8c4d8c30731f (diff) | |
download | mahoro-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-x | test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -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')) |