文件路径后方括号中的信息在RSpec中是什么意思?
What does information in square brackets after a file path mean in RSpec?
RSpec 的文档提到了 --bisect option ,当 运行 提供最小复制时,例如
rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] --seed 1234
[1:1]
位是什么意思?
来自rspec --help
:
**** Filtering/tags ****
In addition to the following options for selecting specific files, groups, or
examples, you can select individual examples by appending the line number(s) to
the filename:
rspec path/to/a_spec.rb:37:87
You can also pass example ids enclosed in square brackets:
rspec path/to/a_spec.rb[1:5,1:6]
# run the 5th and 6th examples/groups defined in the 1st group
在 RSpec 3.3 的发行说明中提到:
RSpec 3.3 introduces a new way to identify examples and example
groups: unique IDs. The IDs are scoped to a particular file and are
based on the index of the example or group. For example, this command:
$ rspec spec/unit/baseball_spec.rb[1:2,1:4]
…would run the 2nd and 4th
example or group defined under the 1st top-level group defined in
spec/unit/baseball_spec.rb.
RSpec 的文档提到了 --bisect option ,当 运行 提供最小复制时,例如
rspec ./spec/calculator_10_spec.rb[1:1] ./spec/calculator_1_spec.rb[1:1] --seed 1234
[1:1]
位是什么意思?
来自rspec --help
:
**** Filtering/tags ****
In addition to the following options for selecting specific files, groups, or examples, you can select individual examples by appending the line number(s) to the filename:
rspec path/to/a_spec.rb:37:87
You can also pass example ids enclosed in square brackets:
rspec path/to/a_spec.rb[1:5,1:6] # run the 5th and 6th examples/groups defined in the 1st group
在 RSpec 3.3 的发行说明中提到:
RSpec 3.3 introduces a new way to identify examples and example groups: unique IDs. The IDs are scoped to a particular file and are based on the index of the example or group. For example, this command:
$ rspec spec/unit/baseball_spec.rb[1:2,1:4]
…would run the 2nd and 4th example or group defined under the 1st top-level group defined in spec/unit/baseball_spec.rb.