Skip to content

Commit 8ae0b4a

Browse files
[skip ci] Testing by line range documentation added in guide
Review changes updated Update railties/lib/rails/commands/test/USAGE Co-authored-by: Yasuo Honda <[email protected]> Update guides/source/testing.md Co-authored-by: Yasuo Honda <[email protected]>
1 parent 3779b50 commit 8ae0b4a

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

guides/source/testing.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,12 @@ You can also run a test at a specific line by providing the line number.
421421
$ bin/rails test test/models/article_test.rb:6 # run specific test and line
422422
```
423423

424+
You can also run a range of tests by providing the line range.
425+
426+
```bash
427+
$ bin/rails test test/models/article_test.rb:6-20 # runs tests from line 6 to 20
428+
```
429+
424430
You can also run an entire directory of tests by providing the path to the directory.
425431

426432
```bash
@@ -438,6 +444,10 @@ You can run a single test by appending a line number to a filename:
438444

439445
bin/rails test test/models/user_test.rb:27
440446

447+
You can run multiple tests with in a line range by appending the line range to a filename:
448+
449+
bin/rails test test/models/user_test.rb:10-20
450+
441451
You can run multiple files and directories at the same time:
442452

443453
bin/rails test test/controllers test/integration/login_test.rb

railties/lib/rails/commands/test/USAGE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Examples:
33

44
<%= executable %> test/models/user_test.rb:27
55

6+
You can run multiple tests with in a line range by appending the line range to a filename:
7+
8+
<%= executable %> test/models/user_test.rb:10-20
9+
610
You can run multiple files and directories at the same time:
711

812
<%= executable %> test/controllers test/integration/login_test.rb

0 commit comments

Comments
 (0)