From cce461511bde8f86aa6f82775320070ccc688273 Mon Sep 17 00:00:00 2001 From: Akira Matsuda Date: Wed, 18 May 2011 20:37:57 +0900 Subject: be sure to parenthesize the arguments when the first one is a RegExp literal this fixes: "warning: ambiguous first argument; put parentheses or even spaces" because: you need this to tell the parser that you're not calling :/ method (division) details (Japanese!): http://blade.nagaokaut.ac.jp/cgi-bin/vframe.rb/ruby/ruby-dev/42445?42370-43277 --- railties/test/generators/resource_generator_test.rb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'railties/test/generators/resource_generator_test.rb') diff --git a/railties/test/generators/resource_generator_test.rb b/railties/test/generators/resource_generator_test.rb index 71b3619351..73804dae45 100644 --- a/railties/test/generators/resource_generator_test.rb +++ b/railties/test/generators/resource_generator_test.rb @@ -9,8 +9,8 @@ class ResourceGeneratorTest < Rails::Generators::TestCase def test_help_with_inherited_options content = run_generator ["--help"] - assert_match /ActiveRecord options:/, content - assert_match /TestUnit options:/, content + assert_match(/ActiveRecord options:/, content) + assert_match(/TestUnit options:/, content) end def test_files_from_inherited_invocation @@ -55,7 +55,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase run_generator assert_file "config/routes.rb" do |route| - assert_match /resources :accounts$/, route + assert_match(/resources :accounts$/, route) end end @@ -63,19 +63,19 @@ class ResourceGeneratorTest < Rails::Generators::TestCase content = run_generator ["accounts".freeze] assert_file "app/models/account.rb", /class Account < ActiveRecord::Base/ assert_file "test/unit/account_test.rb", /class AccountTest/ - assert_match /Plural version of the model detected, using singularized version. Override with --force-plural./, content + assert_match(/Plural version of the model detected, using singularized version. Override with --force-plural./, content) end def test_plural_names_can_be_forced content = run_generator ["accounts", "--force-plural"] assert_file "app/models/accounts.rb", /class Accounts < ActiveRecord::Base/ assert_file "test/unit/accounts_test.rb", /class AccountsTest/ - assert_no_match /Plural version of the model detected/, content + assert_no_match(/Plural version of the model detected/, content) end def test_mass_nouns_do_not_throw_warnings content = run_generator ["sheep".freeze] - assert_no_match /Plural version of the model detected/, content + assert_no_match(/Plural version of the model detected/, content) end def test_route_is_removed_on_revoke @@ -83,7 +83,7 @@ class ResourceGeneratorTest < Rails::Generators::TestCase run_generator ["account"], :behavior => :revoke assert_file "config/routes.rb" do |route| - assert_no_match /resources :accounts$/, route + assert_no_match(/resources :accounts$/, route) end end end -- cgit v1.2.3