| Class | Mocha::MissingExpectation |
| In: |
lib/mocha/expectation.rb
|
| Parent: | Expectation |
# File lib/mocha/expectation.rb, line 114
114: def initialize(method_name, expectations = [])
115: super(method_name)
116: @expectations = expectations
117: @invoked = true
118: end
# File lib/mocha/expectation.rb, line 126
126: def similar_expectations
127: @expectations.select { |expectation| expectation.method_name == self.method_name }
128: end
# File lib/mocha/expectation.rb, line 120
120: def verify
121: msg = "Unexpected message #{message}"
122: msg << "\nSimilar expectations #{similar_expectations.collect { |expectation| expectation.message }.join("\n") }" unless similar_expectations.empty?
123: raise Test::Unit::AssertionFailedError, msg if @invoked
124: end