Skip to content
Browse files

use assert_equal so we get normal error messages along with our custo…

…m failure message
  • Loading branch information...
1 parent 4f90b28 commit 58c3ec1b7b7ee073edf9c245de5d06426be60a25 @tenderlove tenderlove committed Mar 30, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/testing/assertions/routing.rb
View
6 actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -46,7 +46,7 @@ def assert_recognizes(expected_options, path, extras={}, message=nil)
expected_options.stringify_keys!
msg = build_message(message, "The recognized options <?> did not match <?>, difference: <?>",
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
# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
@@ -84,11 +84,11 @@ def assert_generates(expected_path, options, defaults={}, extras = {}, message=n
found_extras = options.reject {|k, v| ! extra_keys.include? k}
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,
expected_path)
- assert_block(msg) { expected_path == generated_path }
+ assert_equal(expected_path, generated_path, msg)
end
# Asserts that path and options match both ways; in other words, it verifies that <tt>path</tt> generates

0 comments on commit 58c3ec1

Please sign in to comment.
Something went wrong with that request. Please try again.