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