Sha256: 190778bd87274dcd1ffbeab1af05b7a19e15b4ae67095c83ad8617c804d9fbd9

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

module Fakes
  module RSpec
    class Occurrences
      class << self
        def from_block(the_block)
          return BlockCriteria.new(the_block)
        end

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

          return from_block(condition)
        end

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

          return from_block(condition)
        end

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

          return from_block(condition)
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fakes-rspec-2.1.0 lib/fakes_rspec/occurrences.rb
fakes-rspec-2.0.0 lib/fakes_rspec/occurrences.rb
fakes-rspec-1.0.6 lib/fakes_rspec/occurrences.rb
fakes-rspec-1.0.5 lib/fakes_rspec/occurrences.rb