Sha256: d3eb7b1f73fc89174755d0864e7af96615fea57be794b3f5cb83383a4c20fada

Contents?: true

Size: 605 Bytes

Versions: 12

Compression:

Stored size: 605 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(regex)
        condition{|string| regex =~ string}
      end

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

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
fakes-1.0.31 lib/core/arg_matching/matches.rb
fakes-1.0.30 lib/core/arg_matching/matches.rb
fakes-1.0.25 lib/core/arg_matching/matches.rb
fakes-1.0.24 lib/core/arg_matching/matches.rb
fakes-1.0.22 lib/core/arg_matching/matches.rb
fakes-1.0.7 lib/fakes/arg_matching/matches.rb
fakes-1.0.6 lib/fakes/arg_matching/matches.rb
fakes-1.0.5 lib/core/arg_matching/matches.rb
fakes-1.0.2 lib/core/arg_matching/matches.rb
fakes-1.0.1 lib/core/arg_matching/matches.rb
fakes-1.0.0 lib/core/arg_matching/matches.rb
fakes-0.4.1 lib/core/arg_matching/matches.rb