File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
spec/rspec/rails/matchers Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,10 @@ def with(expected_attributes)
34
34
self
35
35
end
36
36
37
+ def and ( _ )
38
+ raise ArgumentError , "Chaining is not supported"
39
+ end
40
+
37
41
def matches? ( block )
38
42
if block . nil?
39
43
raise ArgumentError , "block is required for have_reported_error matcher"
Original file line number Diff line number Diff line change @@ -164,8 +164,10 @@ class AnotherTestError < StandardError; end
164
164
165
165
it "works with matcher chaining" do
166
166
expect {
167
- Rails . error . report ( TestError . new ( "test" ) , context : { user_id : 123 } )
168
- } . to have_reported_error ( TestError ) . and have_reported_error
167
+ expect {
168
+ Rails . error . report ( TestError . new ( "test" ) )
169
+ } . to have_reported_error ( TestError ) . and have_reported_error
170
+ } . to raise_error ( ArgumentError , "Chaining is not supported" )
169
171
end
170
172
end
171
173
end
You can’t perform that action at this time.
0 commit comments