| |   |
| 156 | 156 | end |
| 157 | 157 | |
| 158 | 158 | def verify_messages_received |
| 159 | | return if ignoring_args? || matches_exact_count? || |
| 160 | | matches_at_least_count? || matches_at_most_count? |
| 159 | return if expected_messages_received? |
| 161 | 160 | |
| 162 | 161 | generate_error |
| 163 | 162 | rescue Spec::Mocks::MockExpectationError => error |
| … | … | |
| 164 | 164 | Kernel::raise error |
| 165 | 165 | end |
| 166 | 166 | |
| 167 | def expected_messages_received? |
| 168 | ignoring_args? || matches_exact_count? || |
| 169 | matches_at_least_count? || matches_at_most_count? |
| 170 | end |
| 171 | |
| 167 | 172 | def ignoring_args? |
| 168 | 173 | @expected_received_count == :any |
| 169 | 174 | end |
| toggle raw diff |
--- a/rspec/lib/spec/mocks/message_expectation.rb
+++ b/rspec/lib/spec/mocks/message_expectation.rb
@@ -156,8 +156,7 @@ module Spec
end
def verify_messages_received
- return if ignoring_args? || matches_exact_count? ||
- matches_at_least_count? || matches_at_most_count?
+ return if expected_messages_received?
generate_error
rescue Spec::Mocks::MockExpectationError => error
@@ -165,6 +164,11 @@ module Spec
Kernel::raise error
end
+ def expected_messages_received?
+ ignoring_args? || matches_exact_count? ||
+ matches_at_least_count? || matches_at_most_count?
+ end
+
def ignoring_args?
@expected_received_count == :any
end |