aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authorTsukuru Tanimichi <info+git@ttanimichi.com>2017-12-05 18:41:44 +0900
committerTsukuru Tanimichi <info+git@ttanimichi.com>2017-12-05 18:41:44 +0900
commitb9fb74514b752df3b707fa420e09dca459a3844f (patch)
treec0d9b4c642c83bd126d8edfedd7075c1b5fe0d75 /railties/test
parentc383c4142a1ce3b7bbfa241957cd81f398c91231 (diff)
downloadrails-b9fb74514b752df3b707fa420e09dca459a3844f.tar.gz
rails-b9fb74514b752df3b707fa420e09dca459a3844f.tar.bz2
rails-b9fb74514b752df3b707fa420e09dca459a3844f.zip
Modify `test_webpack_option`
Diffstat (limited to 'railties/test')
-rw-r--r--railties/test/generators/app_generator_test.rb8
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