Skip to content

Commit

Permalink
use assert_equal so we get normal error messages along with our custo…
Browse files Browse the repository at this point in the history
…m failure message
  • Loading branch information
tenderlove committed Mar 30, 2011
1 parent 4f90b28 commit 58c3ec1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/action_dispatch/testing/assertions/routing.rb
Expand Up @@ -46,7 +46,7 @@ def assert_recognizes(expected_options, path, extras={}, message=nil)
expected_options.stringify_keys! expected_options.stringify_keys!
msg = build_message(message, "The recognized options <?> did not match <?>, difference: <?>", msg = build_message(message, "The recognized options <?> did not match <?>, difference: <?>",
request.path_parameters, expected_options, expected_options.diff(request.path_parameters)) request.path_parameters, expected_options, expected_options.diff(request.path_parameters))
assert_block(msg) { request.path_parameters == expected_options } assert_equal(expected_options, request.path_parameters, msg)
end end


# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+. # Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
Expand Down Expand Up @@ -84,11 +84,11 @@ def assert_generates(expected_path, options, defaults={}, extras = {}, message=n
found_extras = options.reject {|k, v| ! extra_keys.include? k} found_extras = options.reject {|k, v| ! extra_keys.include? k}


msg = build_message(message, "found extras <?>, not <?>", found_extras, extras) msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
assert_block(msg) { found_extras == extras } assert_equal(extras, found_extras, msg)


msg = build_message(message, "The generated path <?> did not match <?>", generated_path, msg = build_message(message, "The generated path <?> did not match <?>", generated_path,
expected_path) expected_path)
assert_block(msg) { expected_path == generated_path } assert_equal(expected_path, generated_path, msg)
end end


# Asserts that path and options match both ways; in other words, it verifies that <tt>path</tt> generates # Asserts that path and options match both ways; in other words, it verifies that <tt>path</tt> generates
Expand Down

0 comments on commit 58c3ec1

Please sign in to comment.