tags to code blocks
+ code = code.sub(//,'')
+ code = code.sub(/<\/pre>/,"
")
+ end
+
end
end
diff --git a/test/source/_posts/2010-01-08-triple-dash.markdown b/test/source/_posts/2010-01-08-triple-dash.markdown
new file mode 100644
index 00000000..cbb79e7a
--- /dev/null
+++ b/test/source/_posts/2010-01-08-triple-dash.markdown
@@ -0,0 +1,5 @@
+---
+title: Foo --- Bar
+---
+
+Triple the fun!
\ No newline at end of file
diff --git a/test/test_configuration.rb b/test/test_configuration.rb
index 3b05ed51..c6d5ad6c 100644
--- a/test/test_configuration.rb
+++ b/test/test_configuration.rb
@@ -8,21 +8,21 @@ class TestConfiguration < Test::Unit::TestCase
should "fire warning with no _config.yml" do
mock(YAML).load_file(@path) { raise "No such file or directory - #{@path}" }
- mock(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).")
- mock(STDERR).puts("\tNo such file or directory - #{@path}")
+ mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
+ mock($stderr).puts("\tNo such file or directory - #{@path}")
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
end
should "load configuration as hash" do
mock(YAML).load_file(@path) { Hash.new }
- mock(STDOUT).puts("Configuration from #{@path}")
+ mock($stdout).puts("Configuration from #{@path}")
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
end
should "fire warning with bad config" do
mock(YAML).load_file(@path) { Array.new }
- mock(STDERR).puts("WARNING: Could not read configuration. Using defaults (and options).")
- mock(STDERR).puts("\tInvalid configuration - #{@path}")
+ mock($stderr).puts("WARNING: Could not read configuration. Using defaults (and options).")
+ mock($stderr).puts("\tInvalid configuration - #{@path}")
assert_equal Jekyll::DEFAULTS, Jekyll.configuration({})
end
end
diff --git a/test/test_generated_site.rb b/test/test_generated_site.rb
index fe9878e9..357dd4db 100644
--- a/test/test_generated_site.rb
+++ b/test/test_generated_site.rb
@@ -14,7 +14,7 @@ class TestGeneratedSite < Test::Unit::TestCase
end
should "ensure post count is as expected" do
- assert_equal 17, @site.posts.size
+ assert_equal 18, @site.posts.size
end
should "insert site.posts into the index" do
diff --git a/test/test_post.rb b/test/test_post.rb
index 78b86730..36a3f287 100644
--- a/test/test_post.rb
+++ b/test/test_post.rb
@@ -78,7 +78,19 @@ 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\nThis is the content", @post.content
+ assert_equal "This is the content", @post.content
+ end
+ end
+
+ context "with embedded triple dash" do
+ setup do
+ @real_file = "2010-01-08-triple-dash.markdown"
+ end
+ should "consume the embedded dashes" do
+ @post.read_yaml(@source, @real_file)
+
+ assert_equal({"title" => "Foo --- Bar"}, @post.data)
+ assert_equal "Triple the fun!", @post.content
end
end
@@ -164,7 +176,7 @@ class TestPost < Test::Unit::TestCase
@post.read_yaml(@source, @real_file)
assert_equal({"title" => "Foo Bar", "layout" => "default"}, @post.data)
- assert_equal "\nh1. {{ page.title }}\n\nBest *post* ever", @post.content
+ assert_equal "h1. {{ page.title }}\n\nBest *post* ever", @post.content
end
should "transform textile" do
diff --git a/test/test_tags.rb b/test/test_tags.rb
index 0c3caa6d..64119572 100644
--- a/test/test_tags.rb
+++ b/test/test_tags.rb
@@ -49,7 +49,7 @@ CONTENT
end
should "render markdown with pygments line handling" do
- assert_match %{test\n
}, @result
+ assert_match %{test\n
}, @result
end
end
@@ -59,7 +59,7 @@ CONTENT
end
should "render markdown with pygments line handling" do
- assert_match %{Æ\n
}, @result
+ assert_match %{Æ\n
}, @result
end
end