diff options
author | Adrian Sanchez <adrian.saz@gmail.com> | 2010-05-05 01:39:59 -0500 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-05-15 09:43:20 +0200 |
commit | bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27 (patch) | |
tree | 6b855b8b672057f86a2a1c0bf1cd1eb0a4d7ef3e /railties | |
parent | 9869ee77cdbf8f0e9c7eb6e33738d0aa8f5dc70a (diff) | |
download | rails-bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27.tar.gz rails-bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27.tar.bz2 rails-bcf5fea5e5a22edd5c7b27c29a53de0a4bedbc27.zip |
Bundler deprecated options in Gemfile with application template using method "gem" [#4534 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/generators/actions.rb | 3 | ||||
-rw-r--r-- | railties/test/generators/actions_test.rb | 14 |
2 files changed, 14 insertions, 3 deletions
diff --git a/railties/lib/rails/generators/actions.rb b/railties/lib/rails/generators/actions.rb index a31932906d..7af329bbf0 100644 --- a/railties/lib/rails/generators/actions.rb +++ b/railties/lib/rails/generators/actions.rb @@ -54,7 +54,8 @@ module Rails name, version = args # Deal with deprecated options - { :env => :only, :lib => :require_as }.each do |old, new| + { :env => :group, :only => :group, + :lib => :require, :require_as => :require }.each do |old, new| next unless options[old] options[new] = options.delete(old) ActiveSupport::Deprecation.warn "#{old.inspect} option in gem is deprecated, use #{new.inspect} instead" diff --git a/railties/test/generators/actions_test.rb b/railties/test/generators/actions_test.rb index e6fab93a87..65fbf61902 100644 --- a/railties/test/generators/actions_test.rb +++ b/railties/test/generators/actions_test.rb @@ -86,8 +86,13 @@ class ActionsTest < Rails::Generators::TestCase action :gem, 'mislav-will-paginate', :lib => 'will-paginate', :source => 'http://gems.github.com' end - assert_file 'Gemfile', /gem "mislav\-will\-paginate", :require_as => "will\-paginate"/ + assert_deprecated do + action :gem, 'thoughtbot-factory_girl', :require_as => 'factory_girl', :source => 'http://gems.github.com' + end + + assert_file 'Gemfile', /gem "mislav\-will\-paginate", :require => "will\-paginate"/ assert_file 'Gemfile', /source "http:\/\/gems\.github\.com"/ + assert_file 'Gemfile', /gem "thoughtbot-factory_girl", :require => "factory_girl"/ end def test_gem_with_env_should_include_all_dependencies_in_gemfile @@ -97,7 +102,12 @@ class ActionsTest < Rails::Generators::TestCase action :gem, 'rspec', :env => %w(development test) end - assert_file 'Gemfile', /gem "rspec", :only => \["development", "test"\]/ + assert_deprecated do + action :gem, 'rspec-rails', :only => %w(development test) + end + + assert_file 'Gemfile', /gem "rspec", :group => \["development", "test"\]/ + assert_file 'Gemfile', /gem "rspec-rails", :group => \["development", "test"\]/ end def test_gem_with_version_should_include_version_in_gemfile |