From fbd1e98cf983572ca9884f17f933ffe92833632a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Fri, 1 Jul 2016 17:34:31 -0300 Subject: Do not run `bundle install` when generating a new plugin. Since bundler 1.12.0, the gemspec is validated so the `bundle install` command will fail just after the gem is created causing confusion to the users. This change was a bug fix to correctly validate gemspecs. --- railties/test/generators/shared_generator_tests.rb | 35 ---------------------- 1 file changed, 35 deletions(-) (limited to 'railties/test/generators/shared_generator_tests.rb') diff --git a/railties/test/generators/shared_generator_tests.rb b/railties/test/generators/shared_generator_tests.rb index e83d54890a..03ea521355 100644 --- a/railties/test/generators/shared_generator_tests.rb +++ b/railties/test/generators/shared_generator_tests.rb @@ -26,30 +26,6 @@ module SharedGeneratorTests default_files.each { |path| assert_file path } end - def assert_generates_with_bundler(options = {}) - generator([destination_root], options) - - command_check = -> command do - @install_called ||= 0 - - case command - when 'install' - @install_called += 1 - assert_equal 1, @install_called, "install expected to be called once, but was called #{@install_called} times" - when 'exec spring binstub --all' - # Called when running tests with spring, let through unscathed. - end - end - - generator.stub :bundle_command, command_check do - quietly { generator.invoke_all } - end - end - - def test_generation_runs_bundle_install - assert_generates_with_bundler - end - def test_plugin_new_generate_pretend run_generator ["testapp", "--pretend"] default_files.each{ |path| assert_no_file File.join("testapp",path) } @@ -114,17 +90,6 @@ module SharedGeneratorTests end end - def test_dev_option - assert_generates_with_bundler dev: true - rails_path = File.expand_path('../../..', Rails.root) - assert_file 'Gemfile', /^gem\s+["']rails["'],\s+path:\s+["']#{Regexp.escape(rails_path)}["']$/ - end - - def test_edge_option - assert_generates_with_bundler edge: true - assert_file 'Gemfile', %r{^gem\s+["']rails["'],\s+github:\s+["']#{Regexp.escape("rails/rails")}["']$} - end - def test_skip_gemfile assert_not_called(generator([destination_root], skip_gemfile: true), :bundle_command) do quietly { generator.invoke_all } -- cgit v1.2.3