1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

just use assert and refute rather than building messages

This commit is contained in:
Aaron Patterson 2012-01-06 11:10:40 -08:00
parent 3abacc0a70
commit d971a1c541

View file

@ -13,9 +13,7 @@ module ActionDispatch
def assert_dom_equal(expected, actual, message = "")
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
full_message = build_message(message, "<?> expected to be == to\n<?>.", expected_dom.to_s, actual_dom.to_s)
assert_block(full_message) { expected_dom == actual_dom }
assert_equal expected_dom, actual_dom
end
# The negated form of +assert_dom_equivalent+.
@ -28,9 +26,7 @@ module ActionDispatch
def assert_dom_not_equal(expected, actual, message = "")
expected_dom = HTML::Document.new(expected).root
actual_dom = HTML::Document.new(actual).root
full_message = build_message(message, "<?> expected to be != to\n<?>.", expected_dom.to_s, actual_dom.to_s)
assert_block(full_message) { expected_dom != actual_dom }
refute_equal expected_dom, actual_dom
end
end
end