fixed test for CRLF (extra newline was being picked up)

This commit is contained in:
Simon Chiang 2009-06-23 20:52:05 -06:00
parent 09946386b1
commit b616a4ceca
2 changed files with 6 additions and 6 deletions

View File

@ -18,10 +18,10 @@ module Jekyll
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]
if self.content =~ /^(---\s*\n.*?\n?)(---.*?\n)/m
self.content = self.content[($1.size + $2.size)..-1]
self.data = YAML.load($1.dup)
self.data = YAML.load($1)
end
end

View File

@ -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