diff options
author | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2017-12-05 18:41:44 +0900 |
---|---|---|
committer | Tsukuru Tanimichi <info+git@ttanimichi.com> | 2017-12-05 18:41:44 +0900 |
commit | b9fb74514b752df3b707fa420e09dca459a3844f (patch) | |
tree | c0d9b4c642c83bd126d8edfedd7075c1b5fe0d75 | |
parent | c383c4142a1ce3b7bbfa241957cd81f398c91231 (diff) | |
download | rails-b9fb74514b752df3b707fa420e09dca459a3844f.tar.gz rails-b9fb74514b752df3b707fa420e09dca459a3844f.tar.bz2 rails-b9fb74514b752df3b707fa420e09dca459a3844f.zip |
Modify `test_webpack_option`
-rw-r--r-- | railties/test/generators/app_generator_test.rb | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/railties/test/generators/app_generator_test.rb b/railties/test/generators/app_generator_test.rb index decea77d48..68b31148d6 100644 --- a/railties/test/generators/app_generator_test.rb +++ b/railties/test/generators/app_generator_test.rb @@ -746,11 +746,13 @@ class AppGeneratorTest < Rails::Generators::TestCase def test_webpack_option command_check = -> command, *_ do @called ||= 0 - @called += 1 if command == "webpacker:install" - assert_equal 1, @called, "webpacker:install expected to be called once, but was called #{@called} times." + if command == "webpacker:install" + @called += 1 + assert_equal 1, @called, "webpacker:install expected to be called once, but was called #{@called} times." + end end - generator([destination_root], webpack: true).stub(:rails_command, command_check) do + generator([destination_root], webpack: "webpack").stub(:rails_command, command_check) do quietly { generator.invoke_all } end |