Sha256: 6744ad689fd3a7bbec146de98c8848e5f8dd6cdd862f75a5821c99f2ac4acb39

Contents?: true

Size: 829 Bytes

Versions: 118

Compression:

Stored size: 829 Bytes

Contents

require 'mocha/parameter_matchers/base'

module Mocha
  
  module ParameterMatchers

    # :call-seq: any_parameters() -> parameter_matcher
    #
    # Matches any parameters.
    #   object = mock()
    #   object.expects(:method_1).with(any_parameters)
    #   object.method_1(1, 2, 3, 4)
    #   # no error raised
    #
    #   object = mock()
    #   object.expects(:method_1).with(any_parameters)
    #   object.method_1(5, 6, 7, 8, 9, 0)
    #   # no error raised
    def any_parameters
      AnyParameters.new
    end

    class AnyParameters < Base # :nodoc:
      
      def matches?(available_parameters)
        while available_parameters.length > 0 do
          available_parameters.shift
        end
        return true
      end

      def mocha_inspect
        "any_parameters"
      end

    end
    
  end
  
end

Version data entries

118 entries across 113 versions & 13 rubygems

Version Path
dradis-mediawiki-4.14.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.13.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.11.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.10.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.9.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.8.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.7.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.6.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.5.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.4.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.3.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.2.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.1.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-4.0.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.22.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.21.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.20.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.19.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.18.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb
dradis-mediawiki-3.17.0 test/vendor/mocha-0.9.5/lib/mocha/parameter_matchers/any_parameters.rb