no good reason for making 'name' an instance variable
This commit is contained in:
parent
cf42c56630
commit
a5c908ac3f
|
@ -20,24 +20,24 @@ class TestConvertible < Test::Unit::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
should "not parse if there is syntax error in front-matter" do
|
should "not parse if there is syntax error in front-matter" do
|
||||||
@name = 'broken_front_matter2.erb'
|
name = 'broken_front_matter2.erb'
|
||||||
out = capture_stdout do
|
out = capture_stdout do
|
||||||
ret = @convertible.read_yaml(@base, @name)
|
ret = @convertible.read_yaml(@base, name)
|
||||||
assert_equal({}, ret)
|
assert_equal({}, ret)
|
||||||
end
|
end
|
||||||
assert_match(/YAML Exception|syntax error/, out)
|
assert_match(/YAML Exception|syntax error/, out)
|
||||||
assert_match(/#{File.join(@base, @name)}/, out)
|
assert_match(/#{File.join(@base, name)}/, out)
|
||||||
end
|
end
|
||||||
|
|
||||||
if RUBY_VERSION >= '1.9.2'
|
if RUBY_VERSION >= '1.9.2'
|
||||||
should "not parse if there is encoding error in file" do
|
should "not parse if there is encoding error in file" do
|
||||||
@name = 'broken_front_matter3.erb'
|
name = 'broken_front_matter3.erb'
|
||||||
out = capture_stdout do
|
out = capture_stdout do
|
||||||
ret = @convertible.read_yaml(@base, @name)
|
ret = @convertible.read_yaml(@base, name)
|
||||||
assert_equal({}, ret)
|
assert_equal({}, ret)
|
||||||
end
|
end
|
||||||
assert_match(/invalid byte sequence in UTF-8/, out)
|
assert_match(/invalid byte sequence in UTF-8/, out)
|
||||||
assert_match(/#{File.join(@base, @name)}/, out)
|
assert_match(/#{File.join(@base, name)}/, out)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue