diff options
author | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-08 10:01:32 +0200 |
---|---|---|
committer | Kasper Timm Hansen <kaspth@gmail.com> | 2015-09-08 10:01:32 +0200 |
commit | e75b92c032ddbd0e664c4fd241bec5668e35ee96 (patch) | |
tree | 89bfe03a29b141815dedb818b2b04638bcb72162 /railties/test/application | |
parent | b4f82efddcab59685d67950f84719316142ebf3c (diff) | |
parent | df744b56cc21a1fe5302f70515116be918a98498 (diff) | |
download | rails-e75b92c032ddbd0e664c4fd241bec5668e35ee96.tar.gz rails-e75b92c032ddbd0e664c4fd241bec5668e35ee96.tar.bz2 rails-e75b92c032ddbd0e664c4fd241bec5668e35ee96.zip |
Merge pull request #21519 from y-yagi/test_runner_raise_error
raise LoadError when a non-existent file or directory is specified to the test runner
Diffstat (limited to 'railties/test/application')
-rw-r--r-- | railties/test/application/test_runner_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/railties/test/application/test_runner_test.rb b/railties/test/application/test_runner_test.rb index 494e6dd7bd..2d47a31826 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -340,6 +340,11 @@ module ApplicationTests assert_match '0 runs, 0 assertions', run_test_command('') end + def test_raise_error_when_specified_file_does_not_exist + error = capture(:stderr) { run_test_command('test/not_exists.rb') } + assert_match(%r{cannot load such file.+test/not_exists\.rb}, error) + end + private def run_test_command(arguments = 'test/unit/test_test.rb') Dir.chdir(app_path) { `bin/rails t #{arguments}` } |