Class: DevelopWithPassion::Fakes::RSpec::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.



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

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



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

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