未验证 提交 4943c7ed 编写于 作者: Y Yuji Yaginuma 提交者: GitHub

Prevent to install gems when run test (#31564)

`invoke_all` cause `bundle install`. This will install gems actually
defined in `Gemfile`. To avoid this, stubbed `bundle_command`.

Fixes #31557
上级 9596d78a
...@@ -324,7 +324,9 @@ def test_active_storage_install ...@@ -324,7 +324,9 @@ def test_active_storage_install
end end
generator.stub :rails_command, command_check do generator.stub :rails_command, command_check do
quietly { generator.invoke_all } generator.stub :bundle_command, nil do
quietly { generator.invoke_all }
end
end end
end end
...@@ -762,7 +764,9 @@ def test_webpack_option ...@@ -762,7 +764,9 @@ def test_webpack_option
end end
generator([destination_root], webpack: "webpack").stub(:rails_command, command_check) do generator([destination_root], webpack: "webpack").stub(:rails_command, command_check) do
quietly { generator.invoke_all } generator.stub :bundle_command, nil do
quietly { generator.invoke_all }
end
end end
assert_gem "webpacker" assert_gem "webpacker"
...@@ -783,7 +787,9 @@ def test_webpack_option_with_js_framework ...@@ -783,7 +787,9 @@ def test_webpack_option_with_js_framework
end end
generator([destination_root], webpack: "react").stub(:rails_command, command_check) do generator([destination_root], webpack: "react").stub(:rails_command, command_check) do
quietly { generator.invoke_all } generator.stub :bundle_command, nil do
quietly { generator.invoke_all }
end
end end
end end
......
...@@ -92,7 +92,9 @@ def test_template_is_executed_when_supplied_an_https_path ...@@ -92,7 +92,9 @@ def test_template_is_executed_when_supplied_an_https_path
end end
generator([destination_root], template: path).stub(:open, check_open, template) do generator([destination_root], template: path).stub(:open, check_open, template) do
quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) } generator.stub :bundle_command, nil do
quietly { assert_match(/It works!/, capture(:stdout) { generator.invoke_all }) }
end
end end
end end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册