fixed test for CRLF (extra newline was being picked up)
This commit is contained in:
parent
09946386b1
commit
b616a4ceca
|
@ -18,10 +18,10 @@ module Jekyll
|
||||||
def read_yaml(base, name)
|
def read_yaml(base, name)
|
||||||
self.content = File.read(File.join(base, name))
|
self.content = File.read(File.join(base, name))
|
||||||
|
|
||||||
if self.content =~ /^(---\s*\n.*?)\r?\n---\s*\n/m
|
if self.content =~ /^(---\s*\n.*?\n?)(---.*?\n)/m
|
||||||
self.content = self.content[($1.size + 5)..-1]
|
self.content = self.content[($1.size + $2.size)..-1]
|
||||||
|
|
||||||
self.data = YAML.load($1.dup)
|
self.data = YAML.load($1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ class TestPost < Test::Unit::TestCase
|
||||||
@post.read_yaml(@source, @real_file)
|
@post.read_yaml(@source, @real_file)
|
||||||
|
|
||||||
assert_equal({"title" => "Test title", "layout" => "post", "tag" => "Ruby"}, @post.data)
|
assert_equal({"title" => "Test title", "layout" => "post", "tag" => "Ruby"}, @post.data)
|
||||||
assert_equal "\r\n\r\nThis is the content", @post.content
|
assert_equal "\r\nThis is the content", @post.content
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue