|
13 | 13 | end
|
14 | 14 |
|
15 | 15 | require 'fileutils'
|
16 |
| - require 'support/child_process_helper' |
| 16 | + require 'mrss/child_process_helper' |
17 | 17 | require 'open-uri'
|
18 | 18 |
|
19 | 19 | FileUtils.mkdir_p(TMP_BASE)
|
|
91 | 91 | ['~> 5.1.0', '~> 5.2.0', '~> 6.0.0'].each do |rails_version|
|
92 | 92 | context "with rails #{rails_version}" do
|
93 | 93 | it 'creates' do
|
94 |
| - ChildProcessHelper.check_call(%w(gem uni rails -a)) |
95 |
| - ChildProcessHelper.check_call(%w(gem install rails --no-document -v) + [rails_version]) |
| 94 | + Mrss::ChildProcessHelper.check_call(%w(gem uni rails -a)) |
| 95 | + Mrss::ChildProcessHelper.check_call(%w(gem install rails --no-document -v) + [rails_version]) |
96 | 96 |
|
97 | 97 | Dir.chdir(TMP_BASE) do
|
98 | 98 | FileUtils.rm_rf('mongoid-test')
|
99 |
| - ChildProcessHelper.check_call(%w(rails new mongoid-test --skip-spring --skip-active-record), env: clean_env) |
| 99 | + Mrss::ChildProcessHelper.check_call(%w(rails new mongoid-test --skip-spring --skip-active-record), env: clean_env) |
100 | 100 |
|
101 | 101 | Dir.chdir('mongoid-test') do
|
102 | 102 | adjust_app_gemfile
|
103 |
| - ChildProcessHelper.check_call(%w(bundle install), env: clean_env) |
| 103 | + Mrss::ChildProcessHelper.check_call(%w(bundle install), env: clean_env) |
104 | 104 |
|
105 |
| - ChildProcessHelper.check_call(%w(rails g model post), env: clean_env) |
106 |
| - ChildProcessHelper.check_call(%w(rails g model comment post:belongs_to), env: clean_env) |
| 105 | + Mrss::ChildProcessHelper.check_call(%w(rails g model post), env: clean_env) |
| 106 | + Mrss::ChildProcessHelper.check_call(%w(rails g model comment post:belongs_to), env: clean_env) |
107 | 107 |
|
108 | 108 | # https://jira.mongodb.org/browse/MONGOID-4885
|
109 | 109 | comment_text = File.read('app/models/comment.rb')
|
|
136 | 136 | before do
|
137 | 137 | Dir.chdir(APP_PATH) do
|
138 | 138 | remove_bundler_req
|
139 |
| - ChildProcessHelper.check_call(%w(bundle install), env: env) |
| 139 | + Mrss::ChildProcessHelper.check_call(%w(bundle install), env: env) |
140 | 140 | write_mongoid_yml
|
141 | 141 | end
|
142 | 142 |
|
|
150 | 150 | end
|
151 | 151 | index.should be nil
|
152 | 152 |
|
153 |
| - ChildProcessHelper.check_call(%w(rake db:mongoid:create_indexes), |
| 153 | + Mrss::ChildProcessHelper.check_call(%w(rake db:mongoid:create_indexes), |
154 | 154 | cwd: APP_PATH, env: env)
|
155 | 155 |
|
156 | 156 | index = client['posts'].indexes.detect do |index|
|
|
168 | 168 | def clone_application(repo_url, subdir: nil, rails_version: nil)
|
169 | 169 | Dir.chdir(TMP_BASE) do
|
170 | 170 | FileUtils.rm_rf(File.basename(repo_url))
|
171 |
| - ChildProcessHelper.check_call(%w(git clone) + [repo_url]) |
| 171 | + Mrss::ChildProcessHelper.check_call(%w(git clone) + [repo_url]) |
172 | 172 | Dir.chdir(File.join(*[File.basename(repo_url), subdir].compact)) do
|
173 | 173 | adjust_app_gemfile(rails_version: rails_version)
|
174 |
| - ChildProcessHelper.check_call(%w(bundle install), env: clean_env) |
| 174 | + Mrss::ChildProcessHelper.check_call(%w(bundle install), env: clean_env) |
175 | 175 | puts `git diff`
|
176 | 176 |
|
177 | 177 | write_mongoid_yml
|
@@ -230,7 +230,7 @@ def remove_spring
|
230 | 230 | # in `initialize': too long unix socket path (126bytes given but 108bytes max) (ArgumentError)
|
231 | 231 | # Is it trying to create unix sockets in current directory?
|
232 | 232 | # https://stackoverflow.com/questions/30302021/rails-runner-without-spring
|
233 |
| - ChildProcessHelper.check_call(%w(bin/spring binstub --remove --all), env: clean_env) |
| 233 | + Mrss::ChildProcessHelper.check_call(%w(bin/spring binstub --remove --all), env: clean_env) |
234 | 234 | end
|
235 | 235 |
|
236 | 236 | def clean_env
|
|
0 commit comments