diff options
author | Ryan Davis <ryand@zenspider.com> | 2011-11-23 19:33:05 -0800 |
---|---|---|
committer | Ryan Davis <ryand@zenspider.com> | 2011-11-23 19:33:05 -0800 |
commit | bd59ab37d42cb24a6779c65f317420b5de302fa8 (patch) | |
tree | c58b54da6c11ce8afd8736475743b227be22cf1f /test | |
parent | cb9b0d1570deb875f630cbea6dce2129470c2259 (diff) | |
download | hoe-bd59ab37d42cb24a6779c65f317420b5de302fa8.tar.gz |
- Fixed Hoe.read_utf to work on both 1.8 and 1.9. Unicode files FTW! (tenderlove)
[git-p4: depot-paths = "//src/hoe/dev/": change = 6763]
Diffstat (limited to 'test')
-rw-r--r-- | test/test_hoe.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/test_hoe.rb b/test/test_hoe.rb index e83d50c..3c5764a 100644 --- a/test/test_hoe.rb +++ b/test/test_hoe.rb @@ -104,7 +104,13 @@ class TestHoe < MiniTest::Unit::TestCase Tempfile.open 'BOM' do |io| io.write "\xEF\xBB\xBFBOM" io.rewind - assert_equal 'BOM', File.read_utf(io.path) + + content = File.read_utf io.path + assert_equal 'BOM', content + + if content.respond_to? :encoding then + assert_equal Encoding::UTF_8, content.encoding + end end end |