Add tests in all the time that was omitted for Ruby 1.8.x

This commit is contained in:
Parker Moore 2013-12-08 00:48:25 -05:00
parent b4b6df5b6c
commit f14c9db282
1 changed files with 7 additions and 9 deletions

View File

@ -36,16 +36,14 @@ class TestConvertible < Test::Unit::TestCase
assert_no_match /undefined class\/module DoesNotExist/, out
end
if RUBY_VERSION >= '1.9.2'
should "not parse if there is encoding error in file" do
name = 'broken_front_matter3.erb'
out = capture_stdout do
ret = @convertible.read_yaml(@base, name, :encoding => 'utf-8')
assert_equal({}, ret)
end
assert_match(/invalid byte sequence in UTF-8/, out)
assert_match(/#{File.join(@base, name)}/, out)
should "not parse if there is encoding error in file" do
name = 'broken_front_matter3.erb'
out = capture_stdout do
ret = @convertible.read_yaml(@base, name, :encoding => 'utf-8')
assert_equal({}, ret)
end
assert_match(/invalid byte sequence in UTF-8/, out)
assert_match(/#{File.join(@base, name)}/, out)
end
end
end