From 5ab0c1a8ccbaff92cf239aecb78c1537fd6ce1be Mon Sep 17 00:00:00 2001 From: "yuuji.yaginuma" Date: Wed, 13 Mar 2019 10:09:41 +0900 Subject: [PATCH] Add test for runner command with `environment` option --- railties/test/application/runner_test.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb index 8f5f48c281f..d590b6f6fbc 100644 --- a/railties/test/application/runner_test.rb +++ b/railties/test/application/runner_test.rb @@ -105,6 +105,10 @@ module ApplicationTests assert_match "development", rails("runner", "puts Rails.env") end + def test_environment_option + assert_match "production", rails("runner", "-e", "production", "puts Rails.env") + end + def test_runner_detects_syntax_errors output = rails("runner", "puts 'hello world", allow_failure: true) assert_not_predicate $?, :success?