diff --git a/test/test_gitcode.rb b/test/test_gitcode.rb index 0a7890e9..c2c9f319 100644 --- a/test/test_gitcode.rb +++ b/test/test_gitcode.rb @@ -25,7 +25,7 @@ context "gitcode" do end test 'that the rendered output is correctly fetched and rendered as html code' do - assert_equal %Q{
a
\n\n<ol class=\"tree\">\n <li class=\"file\"><a href=\"0\">0</a></li>\n</ol>\nb
}, @rendered + assert_equal %Q{a
\n\n<ol class=\"tree\">\n <li class=\"file\"><a href=\"0\">0</a></li>\n</ol>\n\nb
}, @rendered end test 'contents' do diff --git a/test/test_markup.rb b/test/test_markup.rb index 57f06568..7be218de 100644 --- a/test/test_markup.rb +++ b/test/test_markup.rb @@ -193,7 +193,7 @@ context "Markup" do test "wiki link within inline code block" do @wiki.write_page("Potato", :markdown, "`sed -i '' 's/[[:space:]]*$//'`", commit_details) page = @wiki.page("Potato") - assert_equal "sed -i '' 's/[[:space:]]*$//'
\n sed -i '' 's/[[:space:]]*$//'\n
rot13='tr '\\''A-Za-z'\\'' '\\''N-ZA-Mn-za-m'\\'\n
\n}.strip # remove trailing \n
+ expected = %Q{\n rot13='tr '\\''A-Za-z'\\'' '\\''N-ZA-Mn-za-m'\\'\n
\n\n}
assert_equal expected, output
end
@@ -220,7 +220,7 @@ context "Markup" do
~~~
), commit_details)
output = @wiki.page(page).formatted_data
- expected = %Q{'hi'\n'hi'\n\n'hi'\n'hi'\n\n~~\n'hi'~\n~~\n'hi'~\n\nsed -i '' 's/[[:space:]]*$//'\n", page.formatted_data
+ assert_equal "\n sed -i '' 's/[[:space:]]*$//'\n\n", page.formatted_data
end
test "piped wiki link within code block" do
@wiki.write_page("Potato", :markdown, "`make a link [[home|sweet home]]`", commit_details)
page = @wiki.page("Potato")
- assert_equal "make a link [[home|sweet home]]
\n make a link [[home|sweet home]]\n
a
b
a
b
a b
a b
a
a b
a
a b
a
a b
a
a b
a
a b
a
a b
a
b
a
b
a 
b
a 
b
a
b
a
a
b
a
a
b
a
a
b
a
a
b
a
a
\n\n
b
" + output = "a
b
" relative_image(content, output) end test "image with float and align" do %w{left right}.each do |align| content = "a\n\n[[alpha.jpg|float|align=#{align}]]\n\nb" - output = "a
\n\n
b
" + output = "a
b
" relative_image(content, output) end end test "image with frame" do content = "a\n\n[[alpha.jpg|frame]]\n\nb" - output = "a
\n\n
b
" + output = "a
b
" relative_image(content, output) end test "absolute image with frame" do content = "a\n\n[[http://example.com/bilbo.jpg|frame]]\n\nb" - output = "a
\n\n
b
" + output = "a
b
" relative_image(content, output) end test "image with frame and alt" do content = "a\n\n[[alpha.jpg|frame|alt=Alpha]]\n\nb" - output = "a
\n\n
Alpha
b
" + output = "a
b
" relative_image(content, output) end @@ -461,7 +461,7 @@ context "Markup" do test "code blocks" do content = "a\n\n```ruby\nx = 1\n```\n\nb" - output = %Q{a
\n\nx = 1\nb
} + output = %Q{a
\n\nx = 1\n\nb
} index = @wiki.repo.index index.add("Bilbo-Baggins.md", content) @@ -474,7 +474,7 @@ context "Markup" do test "code blocks with carriage returns" do content = "a\r\n\r\n```ruby\r\nx = 1\r\n```\r\n\r\nb" - output = %Q{a
\n\nx = 1\nb
} + output = %Q{a
\n\nx = 1\n\nb
} index = @wiki.repo.index index.add("Bilbo-Baggins.md", content) @@ -505,7 +505,7 @@ context "Markup" do test "code blocks with multibyte caracters indent" do content = "a\n\n```ruby\ns = 'やくしまるえつこ'\n```\n\nb" - output = %Q{a
\n\ns = 'やくしまるえつこ'\nb
} + output = %Q{a
\n\ns = 'やくしまるえつこ'\n\nb
} index = @wiki.repo.index index.add("Bilbo-Baggins.md", content) index.commit("Add alpha.jpg") @@ -565,7 +565,7 @@ np.array([[2,2],[1,3]],np.float) output_page = @wiki.page("page").formatted_data assert_equal %Q{a b
}, output_script - assert_equal %Q{<p>a b</p>\n<p>a b</p>\n\na\n
<p>a\n!base</p>\na\n
<p>a\n!base</p>\n\na\n
<p>a\n!rel</p>\na\n
<p>a\n!rel</p>\n\nBilbo Baggins} + assert page.formatted_data =~ %r{
Bilbo Baggins} assert_equal 'Bilbo-Baggins.md', page.path assert_equal :markdown, page.format assert_equal @wiki.repo.commits.first.id, page.version.id diff --git a/test/test_wiki.rb b/test/test_wiki.rb index eaed4676..d5b2209c 100644 --- a/test/test_wiki.rb +++ b/test/test_wiki.rb @@ -123,7 +123,7 @@ context "Wiki page previewing" do test "preview_page" do page = @wiki.preview_page("Test", "# Bilbo", :markdown) assert_equal "# Bilbo", page.raw_data - assert_equal %Q{