aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/generators/shared_generator_tests.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2016-07-01 17:34:31 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2016-07-01 22:19:47 -0300
commitfbd1e98cf983572ca9884f17f933ffe92833632a (patch)
treefd569888ce2e9f4cd09e1676d47868bd64e7613c /railties/test/generators/shared_generator_tests.rb
parent14996a1490baefb34d64c68403c1b5bcf3773736 (diff)
downloadrails-fbd1e98cf983572ca9884f17f933ffe92833632a.tar.gz
rails-fbd1e98cf983572ca9884f17f933ffe92833632a.tar.bz2
rails-fbd1e98cf983572ca9884f17f933ffe92833632a.zip
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.
Diffstat (limited to 'railties/test/generators/shared_generator_tests.rb')
-rw-r--r--railties/test/generators/shared_generator_tests.rb35
1 files changed, 0 insertions, 35 deletions
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 }