Merge pull request #48898 from akhilgkrishnan/line-range-testing-guide

[skip ci] Testing by line range documentation added in guide
This commit is contained in:
Yasuo Honda 2023-08-16 08:33:50 +09:00 committed by GitHub
commit 6db58ed7b6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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