diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-09 23:03:32 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2007-09-09 23:03:32 +0000 |
commit | 2c690edb940b55366bc479fc7e51fc620fd85d5b (patch) | |
tree | 88951dac2e1773bf140240cfc6dc4de7ef2197aa /actionpack/lib/action_controller/assertions/dom_assertions.rb | |
parent | 46f217b2988a03c977d074565a7d3ac17c789751 (diff) | |
download | rails-2c690edb940b55366bc479fc7e51fc620fd85d5b.tar.gz rails-2c690edb940b55366bc479fc7e51fc620fd85d5b.tar.bz2 rails-2c690edb940b55366bc479fc7e51fc620fd85d5b.zip |
Random hits from the style nazi
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7437 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/assertions/dom_assertions.rb')
-rw-r--r-- | actionpack/lib/action_controller/assertions/dom_assertions.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/assertions/dom_assertions.rb b/actionpack/lib/action_controller/assertions/dom_assertions.rb index 355080fe54..0b8c78d9b3 100644 --- a/actionpack/lib/action_controller/assertions/dom_assertions.rb +++ b/actionpack/lib/action_controller/assertions/dom_assertions.rb @@ -2,21 +2,23 @@ module ActionController module Assertions module DomAssertions # Test two HTML strings for equivalency (e.g., identical up to reordering of attributes) - def assert_dom_equal(expected, actual, message="") + def assert_dom_equal(expected, actual, message = "") clean_backtrace do expected_dom = HTML::Document.new(expected).root - actual_dom = HTML::Document.new(actual).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 } end end # The negated form of +assert_dom_equivalent+. - def assert_dom_not_equal(expected, actual, message="") + def assert_dom_not_equal(expected, actual, message = "") clean_backtrace do 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 } end end |