mirror of https://github.com/rails/rails
Merge pull request #45085 from shouichi/test-with-leading-dot-slash
Fix rails test command to handle leading dot slash
This commit is contained in:
commit
b5630e232b
|
@ -1,3 +1,9 @@
|
||||||
|
* Allow relative paths with leading dot slash to be passed to `rails test`.
|
||||||
|
|
||||||
|
Fix `rails test ./test/model/post_test.rb` to run a single test file.
|
||||||
|
|
||||||
|
*Shouichi Kamiya* and *oljfte*
|
||||||
|
|
||||||
* Deprecate `config.enable_dependency_loading`. This flag addressed a limitation of the `classic` autoloader and has no effect nowadays. To fix this deprecation, please just delete the reference.
|
* Deprecate `config.enable_dependency_loading`. This flag addressed a limitation of the `classic` autoloader and has no effect nowadays. To fix this deprecation, please just delete the reference.
|
||||||
|
|
||||||
*Xavier Noria*
|
*Xavier Noria*
|
||||||
|
|
|
@ -89,7 +89,7 @@ module Rails
|
||||||
end
|
end
|
||||||
|
|
||||||
def path_argument?(arg)
|
def path_argument?(arg)
|
||||||
%r"^[/\\]?\w+[/\\]".match?(arg)
|
%r"^\.*[/\\]?\w+[/\\]".match?(arg)
|
||||||
end
|
end
|
||||||
|
|
||||||
def list_tests(argv)
|
def list_tests(argv)
|
||||||
|
|
|
@ -296,6 +296,16 @@ module ApplicationTests
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def test_run_relative_path_with_leading_dot_slash
|
||||||
|
create_test_file :models, "account"
|
||||||
|
create_test_file :models, "post"
|
||||||
|
|
||||||
|
run_test_command("./test/models/account_test.rb").tap do |output|
|
||||||
|
assert_match "AccountTest", output
|
||||||
|
assert_match "1 runs, 1 assertions, 0 failures, 0 errors, 0 skips", output
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def test_run_windows_style_path
|
def test_run_windows_style_path
|
||||||
create_test_file :models, "account"
|
create_test_file :models, "account"
|
||||||
create_test_file :controllers, "accounts_controller"
|
create_test_file :controllers, "accounts_controller"
|
||||||
|
|
Loading…
Reference in New Issue