aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test/application/runner_test.rb
diff options
context:
space:
mode:
authorKasper Timm Hansen <kaspth@gmail.com>2016-08-07 17:19:33 +0200
committerGitHub <noreply@github.com>2016-08-07 17:19:33 +0200
commit33ec865e7b15a2fba4a08e35f85273ad773386ac (patch)
tree4c4bf65bc66feab4e81894b4180b7081f646c0d3 /railties/test/application/runner_test.rb
parentff8035dfeed8c86594c32ef8e9204806e190cb58 (diff)
parentbf71b6a57959f00e2b445037996c32ba45802351 (diff)
downloadrails-33ec865e7b15a2fba4a08e35f85273ad773386ac.tar.gz
rails-33ec865e7b15a2fba4a08e35f85273ad773386ac.tar.bz2
rails-33ec865e7b15a2fba4a08e35f85273ad773386ac.zip
Merge pull request #24260 from y-yagi/show_error_message_when_error_raised_in_rails_runner
show error message when error raised in rails runner
Diffstat (limited to 'railties/test/application/runner_test.rb')
-rw-r--r--railties/test/application/runner_test.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/railties/test/application/runner_test.rb b/railties/test/application/runner_test.rb
index 1c4aa1d4c4..a9f81c1f5c 100644
--- a/railties/test/application/runner_test.rb
+++ b/railties/test/application/runner_test.rb
@@ -74,13 +74,15 @@ module ApplicationTests
end
def test_runner_detects_syntax_errors
- Dir.chdir(app_path) { `bin/rails runner "puts 'hello world" 2>&1` }
- refute $?.success?
+ output = Dir.chdir(app_path) { `bin/rails runner "puts 'hello world" 2>&1` }
+ assert_not $?.success?
+ assert_match 'unterminated string meets end of file', output
end
def test_runner_detects_bad_script_name
- Dir.chdir(app_path) { `bin/rails runner "iuiqwiourowe" 2>&1` }
- refute $?.success?
+ output = Dir.chdir(app_path) { `bin/rails runner "iuiqwiourowe" 2>&1` }
+ assert_not $?.success?
+ assert_match "undefined local variable or method `iuiqwiourowe' for main:Object", output
end
def test_environment_with_rails_env