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/migration_generator_test.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'railties/test/generators/migration_generator_test.rb') diff --git a/railties/test/generators/migration_generator_test.rb b/railties/test/generators/migration_generator_test.rb index 6eecfc8e2e..337257df7d 100644 --- a/railties/test/generators/migration_generator_test.rb +++ b/railties/test/generators/migration_generator_test.rb @@ -35,8 +35,8 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_migration "db/migrate/#{migration}.rb" do |content| assert_method :change, content do |up| - assert_match /add_column :posts, :title, :string/, up - assert_match /add_column :posts, :body, :text/, up + assert_match(/add_column :posts, :title, :string/, up) + assert_match(/add_column :posts, :body, :text/, up) end end end @@ -47,13 +47,13 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_migration "db/migrate/#{migration}.rb" do |content| assert_method :up, content do |up| - assert_match /remove_column :posts, :title/, up - assert_match /remove_column :posts, :body/, up + assert_match(/remove_column :posts, :title/, up) + assert_match(/remove_column :posts, :body/, up) end assert_method :down, content do |down| - assert_match /add_column :posts, :title, :string/, down - assert_match /add_column :posts, :body, :text/, down + assert_match(/add_column :posts, :title, :string/, down) + assert_match(/add_column :posts, :body, :text/, down) end end end @@ -64,11 +64,11 @@ class MigrationGeneratorTest < Rails::Generators::TestCase assert_migration "db/migrate/#{migration}.rb" do |content| assert_method :up, content do |up| - assert_match /^\s*$/, up + assert_match(/^\s*$/, up) end assert_method :down, content do |down| - assert_match /^\s*$/, down + assert_match(/^\s*$/, down) end end end -- cgit v1.2.3