Skip to content

Commit

Permalink
Switch the arguments order of assert_renders
Browse files Browse the repository at this point in the history
For better failure messages, let's switch the arguments order as we are
implicitly relying on assert_equal which expect to have the expected
object first, and the given one then.
  • Loading branch information
robin850 committed Aug 21, 2014
1 parent 5dad831 commit 7312c25
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions test/html5_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def test_that_html5_works_with_code_blocks
</code></pre>
EOE

assert_renders section, section_expected
assert_renders header, header_expected
assert_renders section_expected, section
assert_renders header_expected, header
end
end
4 changes: 2 additions & 2 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def html_equal(html_a, html_b)
Nokogiri::HTML::DocumentFragment.parse(html_b).to_html
end

def assert_renders(markdown, html)
html_equal parser.render(markdown), html
def assert_renders(html, markdown)
html_equal html, parser.render(markdown)
end

private
Expand Down

0 comments on commit 7312c25

Please sign in to comment.