Skip to content

Commit b20a699

Browse files
author
Stanislav (Stas) Katkov
committed
block chaining for .or method as well
1 parent aa4c84d commit b20a699

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

lib/rspec/rails/matchers/have_reported_error.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ def and(_)
4848
raise ArgumentError, "Chaining is not supported"
4949
end
5050

51+
def or(_)
52+
raise ArgumentError, "Chaining is not supported"
53+
end
54+
5155
def matches?(block)
5256
warn_about_nil_error! if @warn_about_nil_error
5357

@@ -225,7 +229,7 @@ def warn_about_negated_with_qualifiers!
225229
end
226230

227231
def has_qualifiers?
228-
!@expected_error.nil? || !@expected_message.nil? || !@attributes.empty?
232+
@expected_error || @expected_message || @attributes
229233
end
230234
end
231235

0 commit comments

Comments
 (0)