aboutsummaryrefslogtreecommitdiffstats
path: root/railties/test
diff options
context:
space:
mode:
authoryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-03-21 10:08:38 +0900
committeryuuji.yaginuma <yuuji.yaginuma@gmail.com>2016-08-03 12:16:16 +0900
commitbf71b6a57959f00e2b445037996c32ba45802351 (patch)
tree47d6757f3bc9a7816f1cfdcce1293f5df22f5993 /railties/test
parentd46d61e46e0053efefcc5409795c1121510c2038 (diff)
downloadrails-bf71b6a57959f00e2b445037996c32ba45802351.tar.gz
rails-bf71b6a57959f00e2b445037996c32ba45802351.tar.bz2
rails-bf71b6a57959f00e2b445037996c32ba45802351.zip
show error message when error raised in rails runner
Diffstat (limited to 'railties/test')
-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 84d90cc6d7..7e68a545e9 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