1
0
Fork 0
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:
Haroon Ahmed 2020-06-19 15:00:45 +01:00
parent d6fda8e019
commit 46045e35ed

View file

@ -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
quietly { generator.invoke_all } generator.stub :bundle_command, nil do
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