File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
lib/rspec/core/formatters
spec/rspec/core/formatters Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -408,6 +408,8 @@ def add(exception)
408
408
# ignore it.
409
409
return if Pending ::PendingExampleFixedError === exception
410
410
411
+ return if exception == self
412
+
411
413
all_exceptions << exception
412
414
413
415
if exception . class . name =~ /RSpec/
Original file line number Diff line number Diff line change @@ -695,6 +695,12 @@ def new_multiple_exception_error
695
695
end
696
696
end
697
697
698
+ it "does not let you add itself to the list of all_exceptions" do
699
+ m = MultipleExceptionError . new
700
+ m . add ( m )
701
+ expect ( m . all_exceptions ) . to_not include ( m )
702
+ end
703
+
698
704
it 'supports the same interface as `RSpec::Expectations::MultipleExpectationsNotMetError`' do
699
705
skip "Skipping to allow an rspec-expectations PR to add a new method and remain green" if ENV [ 'NEW_MUTLI_EXCEPTION_METHOD' ]
700
706
You can’t perform that action at this time.
0 commit comments