From bd59ab37d42cb24a6779c65f317420b5de302fa8 Mon Sep 17 00:00:00 2001 From: Ryan Davis Date: Wed, 23 Nov 2011 19:33:05 -0800 Subject: - 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] --- test/test_hoe.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'test') 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 -- cgit v1.2.1