Class: Fakes::RSpec::Occurrences

Inherits:
Object
  • Object
show all
Defined in:
lib/fakes_rspec/occurrences.rb

Class Method Summary collapse

Class Method Details

.at_least(times) ⇒ Object



15
16
17
18
19
# File 'lib/fakes_rspec/occurrences.rb', line 15

def at_least(times)
  condition = lambda { |occurrences| occurrences >= times }

  return from_block(condition)
end

.at_most(times) ⇒ Object



21
22
23
24
25
# File 'lib/fakes_rspec/occurrences.rb', line 21

def at_most(times)
  condition = lambda { |occurrences| occurrences <= times }

  return from_block(condition)
end

.exact(times) ⇒ Object



9
10
11
12
13
# File 'lib/fakes_rspec/occurrences.rb', line 9

def exact(times)
  condition =  lambda { |occurances| occurances == times }

  return from_block(condition)
end

.from_block(the_block) ⇒ Object



5
6
7
# File 'lib/fakes_rspec/occurrences.rb', line 5

def from_block(the_block)
  return BlockCriteria.new(the_block)
end