Skip to content
This repository was archived by the owner on Nov 30, 2024. It is now read-only.

Commit df35af1

Browse files
committed
Update rspec --help to include more detail about filtering.
- Clarify location filtering. - Add info about id filtering.
1 parent 90e82da commit df35af1

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

.rubocop.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Lint/LiteralInInterpolation:
2525

2626
# This should go down over time.
2727
MethodLength:
28-
Max: 155
28+
Max: 40
2929

3030
# Exclude the default spec_helper to make it easier to uncomment out
3131
# default settings (for both users and the Cucumber suite).

lib/rspec/core/option_parser.rb

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def parse(args)
2121
options
2222
end
2323

24+
# rubocop:disable MethodLength
2425
def parser(options)
2526
OptionParser.new do |parser|
2627
parser.banner = "Usage: rspec [options] [files or directories]\n\n"
@@ -143,11 +144,15 @@ def parser(options)
143144
144145
**** Filtering/tags ****
145146
146-
In addition to the following options for selecting specific files, groups,
147-
or examples, you can select a single example by appending the line number to
147+
In addition to the following options for selecting specific files, groups, or
148+
examples, you can select individual examples by appending the line number(s) to
148149
the filename:
149150
150-
rspec path/to/a_spec.rb:37
151+
rspec path/to/a_spec.rb:37:87
152+
153+
You can also pass example ids enclosed in square brackets:
154+
155+
rspec path/to/a_spec.rb[1:5,1:6] # run the 5th and 6th examples/groups defined in the 1st group
151156
152157
FILTERING
153158

@@ -224,5 +229,6 @@ def parser(options)
224229

225230
end
226231
end
232+
# rubocop:enable MethodLength
227233
end
228234
end

0 commit comments

Comments
 (0)