aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application
diff options
context:
space:
mode:
authorSebastian Martinez <sebastian@wyeworks.com>2011-05-23 21:45:00 -0300
committerSebastian Martinez <sebastian@wyeworks.com>2011-05-23 21:45:00 -0300
commit130c9b71aa7e52cfac011c0c4ee7d24a1b2dcb4e (patch)
tree5b2e05bb1c1c6d3927aaec897d407bb52e7e8d52 /railties/test/application
parent8e7590c72c088e89d73d318d58e5bc3c058dea8f (diff)
downloadrails-130c9b71aa7e52cfac011c0c4ee7d24a1b2dcb4e.tar.gz
rails-130c9b71aa7e52cfac011c0c4ee7d24a1b2dcb4e.tar.bz2
rails-130c9b71aa7e52cfac011c0c4ee7d24a1b2dcb4e.zip
Parenthesize arguments when the first one is a Regexp literal.
This fixes 'warning: ambiguous first argument; put parentheses or even spaces'.
Diffstat (limited to 'railties/test/application')
-rw-r--r--railties/test/application/initializers/notifications_test.rb2
-rw-r--r--railties/test/application/rack/logger_test.rb6
-rw-r--r--railties/test/application/rake_test.rb18
3 files changed, 13 insertions, 13 deletions
diff --git a/railties/test/application/initializers/notifications_test.rb b/railties/test/application/initializers/notifications_test.rb
index 7e035be764..c87433db0d 100644
--- a/railties/test/application/initializers/notifications_test.rb
+++ b/railties/test/application/initializers/notifications_test.rb
@@ -33,7 +33,7 @@ module ApplicationTests
wait
assert_equal 1, logger.logged(:debug).size
- assert_match /SHOW tables/, logger.logged(:debug).last
+ assert_match(/SHOW tables/, logger.logged(:debug).last)
end
end
end
diff --git a/railties/test/application/rack/logger_test.rb b/railties/test/application/rack/logger_test.rb
index a29244357c..715af5c642 100644
--- a/railties/test/application/rack/logger_test.rb
+++ b/railties/test/application/rack/logger_test.rb
@@ -21,19 +21,19 @@ module ApplicationTests
test "logger logs proper HTTP verb and path" do
get "/blah"
wait
- assert_match /^Started GET "\/blah"/, logs[0]
+ assert_match(/^Started GET "\/blah"/, logs[0])
end
test "logger logs HTTP verb override" do
post "/", {:_method => 'put'}
wait
- assert_match /^Started PUT "\/"/, logs[0]
+ assert_match(/^Started PUT "\/"/, logs[0])
end
test "logger logs HEAD requests" do
post "/", {:_method => 'head'}
wait
- assert_match /^Started HEAD "\/"/, logs[0]
+ assert_match(/^Started HEAD "\/"/, logs[0])
end
end
end
diff --git a/railties/test/application/rake_test.rb b/railties/test/application/rake_test.rb
index d77c2d14ab..ab36ace5e5 100644
--- a/railties/test/application/rake_test.rb
+++ b/railties/test/application/rake_test.rb
@@ -31,7 +31,7 @@ module ApplicationTests
AppTemplate::Application.initialize!
RUBY
- assert_match "SuperMiddleware", Dir.chdir(app_path){ `rake middleware` }
+ assert_match("SuperMiddleware", Dir.chdir(app_path){ `rake middleware` })
end
def test_initializers_are_executed_in_rake_tasks
@@ -93,16 +93,16 @@ module ApplicationTests
end
output = Dir.chdir(app_path){ `rake db:migrate` }
- assert_match /create_table\(:users\)/, output
- assert_match /CreateUsers: migrated/, output
- assert_match /add_column\(:users, :email, :string\)/, output
- assert_match /AddEmailToUsers: migrated/, output
+ assert_match(/create_table\(:users\)/, output)
+ assert_match(/CreateUsers: migrated/, output)
+ assert_match(/add_column\(:users, :email, :string\)/, output)
+ assert_match(/AddEmailToUsers: migrated/, output)
output = Dir.chdir(app_path){ `rake db:rollback STEP=2` }
- assert_match /drop_table\("users"\)/, output
- assert_match /CreateUsers: reverted/, output
- assert_match /remove_column\("users", :email\)/, output
- assert_match /AddEmailToUsers: reverted/, output
+ assert_match(/drop_table\("users"\)/, output)
+ assert_match(/CreateUsers: reverted/, output)
+ assert_match(/remove_column\("users", :email\)/, output)
+ assert_match(/AddEmailToUsers: reverted/, output)
end
def test_loading_specific_fixtures