diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-08-03 11:17:07 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-08-03 11:17:07 +0200 |
commit | 465f0fbca3d4a1c269038b84ec9cc248fdab5fab (patch) | |
tree | 8f9d2561508de1c89d426893b5b44777c431e0c3 /railties/test/application | |
parent | c402479f59e248056c87d547ee3ef8482354e917 (diff) | |
download | rails-465f0fbca3d4a1c269038b84ec9cc248fdab5fab.tar.gz rails-465f0fbca3d4a1c269038b84ec9cc248fdab5fab.tar.bz2 rails-465f0fbca3d4a1c269038b84ec9cc248fdab5fab.zip |
test runner should crash with non existing file argument.
Before this patch, using `bin/rails test` with a non existing
file or directory argument would silently swallow the argument and
run the whole test suite.
After the patch the command fails with `cannot load such file --`.
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..d0a7960d3f 100644 --- a/railties/test/application/test_runner_test.rb +++ b/railties/test/application/test_runner_test.rb @@ -307,6 +307,11 @@ module ApplicationTests end end + def test_crash_with_non_existing_file_or_dirname + error = capture(:stderr) { run_test_command('test/nope/niet_test.rb') } + assert_match(%r{cannot load such file.+test/nope/niet_test.rb}, error) + end + def test_shows_filtered_backtrace_by_default create_backtrace_test |