1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Revert changes related to bundle install fixes in rails new

Reverted changes:
  f3482a9 Fix tests in railties
  5904295 improve #6318
  aed906a prevent using already loaded Gemfile for 'bundle install'

In order to fix this, we need a fix in bundler related to GEM_PATH,
which will allow to run tests properly. I will get this changes back
when it happens.
This commit is contained in:
Piotr Sarnacki 2012-05-17 10:19:04 -07:00
parent 319903bde5
commit 0f5cc34ab5
2 changed files with 3 additions and 17 deletions

View file

@ -246,17 +246,8 @@ module Rails
# is easier to silence stdout in the existing test suite this way. The # is easier to silence stdout in the existing test suite this way. The
# end-user gets the bundler commands called anyway, so no big deal. # end-user gets the bundler commands called anyway, so no big deal.
# #
# We unset temporary bundler variables to load proper bundler and Gemfile.
#
# Thanks to James Tucker for the Gem tricks involved in this call. # Thanks to James Tucker for the Gem tricks involved in this call.
_bundle_command = Gem.bin_path('bundler', 'bundle') print `"#{Gem.ruby}" "#{Gem.bin_path('bundler', 'bundle')}" #{command}`
bundle_bin_path, bundle_gemfile, rubyopt = ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT']
ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = "", "", ""
print `"#{Gem.ruby}" "#{_bundle_command}" #{command}`
ENV['BUNDLE_BIN_PATH'], ENV['BUNDLE_GEMFILE'], ENV['RUBYOPT'] = bundle_bin_path, bundle_gemfile, rubyopt
end end
def run_bundle def run_bundle

View file

@ -99,13 +99,7 @@ class PluginNewGeneratorTest < Rails::Generators::TestCase
end end
def test_generation_runs_bundle_install_with_full_and_mountable def test_generation_runs_bundle_install_with_full_and_mountable
result = run_generator [destination_root, "--mountable", "--full", "--dev"] result = run_generator [destination_root, "--mountable", "--full"]
assert_file "#{destination_root}/Gemfile.lock" do |contents|
assert_match(/bukkits/, contents)
end
assert_match(/run bundle install/, result)
assert_match(/Using bukkits \(0\.0\.1\)/, result)
assert_match(/Your bundle is complete/, result)
assert_equal 1, result.scan("Your bundle is complete").size assert_equal 1, result.scan("Your bundle is complete").size
end end
@ -354,3 +348,4 @@ protected
silence(:stdout){ generator.send(*args, &block) } silence(:stdout){ generator.send(*args, &block) }
end end
end end