Class: RSpec::Fakes::ReceivedOccurencesCriteria

Inherits:
Object
  • Object
show all
Defined in:
lib/core/received_occurances_criteria.rb

Instance Method Summary collapse

Constructor Details

#initialize(received_criteria, the_call, occurence) ⇒ ReceivedOccurencesCriteria

Returns a new instance of ReceivedOccurencesCriteria.


4
5
6
7
8
# File 'lib/core/received_occurances_criteria.rb', line 4

def initialize(received_criteria,the_call,occurence)
  @received_criteria = received_criteria
  @the_call = the_call
  @occurence = occurence
end

Instance Method Details

#is_satisfied_by(*args) ⇒ Object


10
11
12
13
# File 'lib/core/received_occurances_criteria.rb', line 10

def is_satisfied_by(*args)
  return @received_criteria.is_satisfied_by(*args) &&
    @occurence.is_satisfied_by((args.count == 0 ? @the_call.total_times_called : @the_call.called_with(*args).times_called))
end