Skip to content

Commit e24ced1

Browse files
committed
Clarify one-liner syntax cannot be used with block matchers
Users sometimes try to use the one-liner syntax with block matchers, which can cause RSpec to behave in strange ways. This behaviour is not supported in RSpec because the complexity of implementing it would greatly outweigh the benefits. This commit just clarifies in the documentation that the one-liner syntax does not support block matchers. Possible fix for rspec/rspec-expectations#805
1 parent de91ba5 commit e24ced1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

features/subject/one_liner_syntax.feature

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Feature: One-liner syntax
2222

2323
* This feature is only available when using rspec-expectations.
2424
* Examples defined using this one-liner syntax cannot be directly selected from the command line using the [`--example` option](../command-line/example-option).
25+
* The one-liner syntax only works with non-block expectations (e.g. `expect(obj).to eq`, etc) and it cannot be used with block expectations (e.g. `expect { object }`).
2526

2627
Scenario: Implicit subject
2728
Given a file named "example_spec.rb" with:

0 commit comments

Comments
 (0)