diff options
author | Akira Matsuda <ronnie@dio.jp> | 2011-05-18 20:37:57 +0900 |
---|---|---|
committer | Akira Matsuda <ronnie@dio.jp> | 2011-05-18 23:20:19 +0900 |
commit | cce461511bde8f86aa6f82775320070ccc688273 (patch) | |
tree | 9fdee4f56bee252783bc1631ca9028d00e6d0aef /railties/test/generators/migration_generator_test.rb | |
parent | 32b9cefb637741ac7158085790cda56360a229f2 (diff) | |
download | rails-cce461511bde8f86aa6f82775320070ccc688273.tar.gz rails-cce461511bde8f86aa6f82775320070ccc688273.tar.bz2 rails-cce461511bde8f86aa6f82775320070ccc688273.zip |
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
Diffstat (limited to 'railties/test/generators/migration_generator_test.rb')
-rw-r--r-- | railties/test/generators/migration_generator_test.rb | 16 |
1 files changed, 8 insertions, 8 deletions
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 |