Class: RSpec::Fakes::Occurances

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

Class Method Summary collapse

Class Method Details

.at_least(times) ⇒ Object


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

def at_least(times)
  return from_block(lambda { |occurences| return occurences >= times})
end

.at_most(times) ⇒ Object


14
15
16
# File 'lib/core/occurances.rb', line 14

def at_most(times)
  return from_block(lambda { |occurences| return occurences <= times})
end

.exact(times) ⇒ Object


8
9
10
# File 'lib/core/occurances.rb', line 8

def exact(times)
  return from_block(lambda{|occurances| return occurances == times})
end

.from_block(the_block) ⇒ Object


5
6
7
# File 'lib/core/occurances.rb', line 5

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