Sha256: 1acaa5e928ca82f4c58ef7eaff2973dbda72b3339c64e54549c1c18faa9ded3e

Contents?: true

Size: 639 Bytes

Versions: 4

Compression:

Stored size: 639 Bytes

Contents

module Fakes
  class Matches
    class << self
      def not_nil
        condition { |item| item != nil }
      end

      def nil
        condition { |item| item == nil }
      end

      def any
        condition { |ignored| true }
      end

      def greater_than(value)
        condition { |number| number > value }
      end
      

      def in_range(range)
        condition { |item| range === item }
      end

      def regex(pattern)
        condition { |string_value| pattern =~ string_value }
      end

      def condition(&conditional_block)
        return BlockArgMatcher.new(conditional_block)
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fakes-1.1.1 lib/fakes/arg_matching/matches.rb
fakes-1.1.0 lib/fakes/arg_matching/matches.rb
fakes-1.0.9 lib/fakes/arg_matching/matches.rb
fakes-1.0.8 lib/fakes/arg_matching/matches.rb