aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-01-06 11:41:08 -0800
committerAaron Patterson <aaron.patterson@gmail.com>2012-01-06 11:41:08 -0800
commita0dc9cae88cd98ccd9ce6788237c6d0855bbf119 (patch)
tree680d31f1e2cdf79950de3f9c77adf262b8e76cf8
parenta0bab371ae30d78ed3eb4df3c516e6b798e801ad (diff)
downloadrails-a0dc9cae88cd98ccd9ce6788237c6d0855bbf119.tar.gz
rails-a0dc9cae88cd98ccd9ce6788237c6d0855bbf119.tar.bz2
rails-a0dc9cae88cd98ccd9ce6788237c6d0855bbf119.zip
use sprintf rather than build_message
-rw-r--r--actionpack/lib/action_dispatch/testing/assertions/routing.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
index b10aab9029..1552676fbb 100644
--- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb
+++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb
@@ -45,9 +45,11 @@ module ActionDispatch
extras.each_key { |key| expected_options.delete key } unless extras.nil?
expected_options.stringify_keys!
- msg = build_message(message, "The recognized options <?> did not match <?>, difference: <?>",
+
+ # FIXME: minitest does object diffs, do we need to have our own?
+ message ||= sprintf("The recognized options <%s> did not match <%s>, difference: <%s>",
request.path_parameters, expected_options, expected_options.diff(request.path_parameters))
- assert_equal(expected_options, request.path_parameters, msg)
+ assert_equal(expected_options, request.path_parameters, message)
end
# Asserts that the provided options can be used to generate the provided path. This is the inverse of +assert_recognizes+.
@@ -84,10 +86,10 @@ module ActionDispatch
generated_path, extra_keys = @routes.generate_extras(options, defaults)
found_extras = options.reject {|k, v| ! extra_keys.include? k}
- msg = build_message(message, "found extras <?>, not <?>", found_extras, extras)
+ msg = message || sprintf("found extras <%s>, not <%s>", found_extras, extras)
assert_equal(extras, found_extras, msg)
- msg = build_message(message, "The generated path <?> did not match <?>", generated_path,
+ msg = message || sprintf("The generated path <%s> did not match <%s>", generated_path,
expected_path)
assert_equal(expected_path, generated_path, msg)
end