Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Silence warning: ambiguous first argument; put parentheses or even sp…

…aces
  • Loading branch information...
commit b45d44cff051a8ca202f5837d024f094e3062089 1 parent 40f0ef7
Bryan Helmkamp brynary authored
Showing with 10 additions and 10 deletions.
  1. +10 −10 actionpack/test/controller/routing_test.rb
20 actionpack/test/controller/routing_test.rb
View
@@ -1102,21 +1102,21 @@ def test_should_list_options_diff_when_routing_requirements_dont_match
map.post 'post/:id', :controller=> 'post', :action=> 'show', :requirements => {:id => /\d+/}
end
exception = assert_raise(ActionController::RoutingError) { rs.generate(:controller => 'post', :action => 'show', :bad_param => "foo", :use_route => "post") }
- assert_match /^post_url failed to generate/, exception.message
+ assert_match(/^post_url failed to generate/, exception.message)
from_match = exception.message.match(/from \{[^\}]+\}/).to_s
- assert_match /:bad_param=>"foo"/, from_match
- assert_match /:action=>"show"/, from_match
- assert_match /:controller=>"post"/, from_match
+ assert_match(/:bad_param=>"foo"/, from_match)
+ assert_match(/:action=>"show"/, from_match)
+ assert_match(/:controller=>"post"/, from_match)
expected_match = exception.message.match(/expected: \{[^\}]+\}/).to_s
- assert_no_match /:bad_param=>"foo"/, expected_match
- assert_match /:action=>"show"/, expected_match
- assert_match /:controller=>"post"/, expected_match
+ assert_no_match(/:bad_param=>"foo"/, expected_match)
+ assert_match( /:action=>"show"/, expected_match)
+ assert_match( /:controller=>"post"/, expected_match)
diff_match = exception.message.match(/diff: \{[^\}]+\}/).to_s
- assert_match /:bad_param=>"foo"/, diff_match
- assert_no_match /:action=>"show"/, diff_match
- assert_no_match /:controller=>"post"/, diff_match
+ assert_match( /:bad_param=>"foo"/, diff_match)
+ assert_no_match(/:action=>"show"/, diff_match)
+ assert_no_match(/:controller=>"post"/, diff_match)
end
# this specifies the case where your formerly would get a very confusing error message with an empty diff
Please sign in to comment.
Something went wrong with that request. Please try again.