提交 41415880 编写于 作者: P Piotr Sarnacki

Revert "Revert changes related to `bundle install` fixes in `rails new`"

The cause of the previous revert was bug in bundler that made it hard to
make railties test work. Fix for bundler was recently pushed to github,
so now we can safely get back to the original commit.

This reverts commit 0f5cc34a.
上级 85098e4b
......@@ -246,8 +246,17 @@ def bundle_command(command)
# 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.
#
# We unset temporary bundler variables to load proper bundler and Gemfile.
#
# Thanks to James Tucker for the Gem tricks involved in this call.
print `"#{Gem.ruby}" "#{Gem.bin_path('bundler', 'bundle')}" #{command}`
_bundle_command = Gem.bin_path('bundler', 'bundle')
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
def run_bundle
......
......@@ -115,7 +115,13 @@ def test_ensure_that_database_option_is_passed_to_app_generator
end
def test_generation_runs_bundle_install_with_full_and_mountable
result = run_generator [destination_root, "--mountable", "--full"]
result = run_generator [destination_root, "--mountable", "--full", "--dev"]
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
end
......@@ -394,4 +400,3 @@ def action(*args, &block)
silence(:stdout){ generator.send(*args, &block) }
end
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册