diff --git a/guides/source/testing.md b/guides/source/testing.md index 43316188aee..87170d66129 100644 --- a/guides/source/testing.md +++ b/guides/source/testing.md @@ -421,6 +421,12 @@ You can also run a test at a specific line by providing the line number. $ bin/rails test test/models/article_test.rb:6 # run specific test and line ``` +You can also run a range of tests by providing the line range. + +```bash +$ bin/rails test test/models/article_test.rb:6-20 # runs tests from line 6 to 20 +``` + You can also run an entire directory of tests by providing the path to the directory. ```bash @@ -438,6 +444,10 @@ You can run a single test by appending a line number to a filename: bin/rails test test/models/user_test.rb:27 +You can run multiple tests with in a line range by appending the line range to a filename: + + bin/rails test test/models/user_test.rb:10-20 + You can run multiple files and directories at the same time: bin/rails test test/controllers test/integration/login_test.rb diff --git a/railties/lib/rails/commands/test/USAGE b/railties/lib/rails/commands/test/USAGE index ffcbdfb44a3..ca13126e838 100644 --- a/railties/lib/rails/commands/test/USAGE +++ b/railties/lib/rails/commands/test/USAGE @@ -3,6 +3,10 @@ Examples: <%= executable %> test/models/user_test.rb:27 + You can run multiple tests with in a line range by appending the line range to a filename: + + <%= executable %> test/models/user_test.rb:10-20 + You can run multiple files and directories at the same time: <%= executable %> test/controllers test/integration/login_test.rb