mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Speed up test_skip_webpack_install from ~10s to < 5s by avoiding the call to bundler, I also added an assertion for webpacker which was needed for this test
This commit is contained in:
parent
d6fda8e019
commit
46045e35ed
1 changed files with 6 additions and 2 deletions
|
@ -955,16 +955,20 @@ class AppGeneratorTest < Rails::Generators::TestCase
|
||||||
end
|
end
|
||||||
|
|
||||||
generator([destination_root], skip_webpack_install: true).stub(:rails_command, command_check) do
|
generator([destination_root], skip_webpack_install: true).stub(:rails_command, command_check) do
|
||||||
|
generator.stub :bundle_command, nil do
|
||||||
quietly { generator.invoke_all }
|
quietly { generator.invoke_all }
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
assert_gem "webpacker"
|
assert_gem "webpacker"
|
||||||
assert_no_file "config/webpacker.yml"
|
assert_no_file "config/webpacker.yml"
|
||||||
|
|
||||||
output = Dir.chdir(destination_root) do
|
output = Dir.chdir(destination_root) do
|
||||||
`rails --help`
|
`bin/rails help`
|
||||||
end
|
end
|
||||||
|
|
||||||
assert_match(/The most common rails commands are:/, output)
|
assert_match(/The most common rails commands are:/, output)
|
||||||
|
assert_match(/webpacker:install/, output)
|
||||||
assert_equal true, $?.success?
|
assert_equal true, $?.success?
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue