aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/test_unit/test_requirer.rb2
-rw-r--r--railties/test/application/test_runner_test.rb5
2 files changed, 6 insertions, 1 deletions
diff --git a/railties/lib/rails/test_unit/test_requirer.rb b/railties/lib/rails/test_unit/test_requirer.rb
index 84c2256729..83d2c55ffd 100644
--- a/railties/lib/rails/test_unit/test_requirer.rb
+++ b/railties/lib/rails/test_unit/test_requirer.rb
@@ -18,7 +18,7 @@ module Rails
arg = arg.gsub(/:(\d+)?$/, '')
if Dir.exist?(arg)
"#{arg}/**/*_test.rb"
- elsif File.file?(arg)
+ else
arg
end
end
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