Sha256: d290541aca9c6b9daa4d765d649806680e5e1e20095ce5ed239a3013f8116554

Contents?: true

Size: 483 Bytes

Versions: 15

Compression:

Stored size: 483 Bytes

Contents

class Surrogate
  module RSpec
    class TimesPredicate
      attr_accessor :expected_times_invoked, :comparer
      def initialize(expected_times_invoked=0, comparer=:<)
        self.expected_times_invoked = expected_times_invoked
        self.comparer = comparer
      end

      def matches?(invocations)
        expected_times_invoked.send comparer, invocations.size
      end

      def default?
        expected_times_invoked == 0 && comparer == :<
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
surrogate-0.8.1 lib/surrogate/rspec/times_predicate.rb
surrogate-0.8.0 lib/surrogate/rspec/times_predicate.rb
surrogate-0.7.0 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.5 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.4 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.3 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.2 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.1 lib/surrogate/rspec/times_predicate.rb
surrogate-0.6.0 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.5 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.4 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.3 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.2 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.1 lib/surrogate/rspec/times_predicate.rb
surrogate-0.5.0 lib/surrogate/rspec/times_predicate.rb