diff options
author | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-09-10 23:51:46 +0900 |
---|---|---|
committer | yuuji.yaginuma <yuuji.yaginuma@gmail.com> | 2016-09-11 11:03:01 +0900 |
commit | 99620d1534ffb47d1496ccc1efae60a90967671c (patch) | |
tree | 994ff46c296181ed164c4f47b7555177f9ea6fb5 /railties | |
parent | cf5f55cd30aef0f90300c7c8f333060fe258cd8a (diff) | |
download | rails-99620d1534ffb47d1496ccc1efae60a90967671c.tar.gz rails-99620d1534ffb47d1496ccc1efae60a90967671c.tar.bz2 rails-99620d1534ffb47d1496ccc1efae60a90967671c.zip |
use correct Gemfile in `bin/setup` test
Currently, `bin/setup` test uses Gemfile of Rails. But this Gemfile is not a
file to be used in Rails application.
Add a Gemfile to Rails application that is created for test, it has been
modified to use the Gemfile.
Diffstat (limited to 'railties')
-rw-r--r-- | railties/test/application/bin_setup_test.rb | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/railties/test/application/bin_setup_test.rb b/railties/test/application/bin_setup_test.rb index 2f076ea2f6..0bbd25db2b 100644 --- a/railties/test/application/bin_setup_test.rb +++ b/railties/test/application/bin_setup_test.rb @@ -6,10 +6,17 @@ module ApplicationTests def setup build_app + + create_gemfile + update_boot_file_to_use_bundler + @old_gemfile_env = ENV["BUNDLE_GEMFILE"] + ENV["BUNDLE_GEMFILE"] = app_path + "/Gemfile" end def teardown teardown_app + + ENV["BUNDLE_GEMFILE"] = @old_gemfile_env end def test_bin_setup @@ -52,5 +59,16 @@ Created database 'db/test.sqlite3' OUTPUT end end + + private + def create_gemfile + app_file("Gemfile", "source 'https://rubygems.org'") + app_file("Gemfile", "gem 'rails', path: '#{RAILS_FRAMEWORK_ROOT}'", "a") + app_file("Gemfile", "gem 'sqlite3'", "a") + end + + def update_boot_file_to_use_bundler + app_file("config/boot.rb", "require 'bundler/setup'") + end end end |