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)
3434 self
3535 end
3636
37+ def and ( _ )
38+ raise ArgumentError , "Chaining is not supported"
39+ end
40+
3741 def matches? ( block )
3842 if block . nil?
3943 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
164164
165165 it "works with matcher chaining" do
166166 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" )
169171 end
170172 end
171173end
You can’t perform that action at this time.
0 commit comments