Sha256: 388c6678bfb5f47b26f0a4d9281197f3ede73e43dd5312de32e61c50ce919869

Contents?: true

Size: 582 Bytes

Versions: 1

Compression:

Stored size: 582 Bytes

Contents

require 'mocha/parameter_matchers/base'

module Mocha
  
  module ParameterMatchers

    # :call-seq: anything -> parameter_matcher
    #
    # Matches any object.
    #   object = mock()
    #   object.expects(:method_1).with(anything)
    #   object.method_1('foo')
    #   # no error raised
    def anything
      Anything.new
    end
    
    class Anything < Base # :nodoc:
    
      def matches?(available_parameters)
        available_parameters.shift
        return true
      end
      
      def mocha_inspect
        "anything"
      end
      
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mocha-0.5.6 lib/mocha/parameter_matchers/anything.rb