Sha256: d797a8f904d2e0b42cc9e69b7956a6ceed88af98609a173cf8bfbdda32d3004f

Contents?: true

Size: 578 Bytes

Versions: 2

Compression:

Stored size: 578 Bytes

Contents

require 'set'

module Spec #:nodoc:
  module Mocks #:nodoc:
    class AnyOrderArgConstraint #:nodoc:
      def initialize(array)
        @array = array
      end
      
      def ==(arg)
        Set.new(@array) == Set.new(arg)
      end
        
      def inspect
        "in_any_order(#{@array.inspect})"
      end
    end
    
    module ArgumentMatchers #:nodoc:
      class AnyArgMatcher #:nodoc:
        def inspect
          'anything'
        end
      end

      def in_any_order(array)
        Spec::Mocks::AnyOrderArgConstraint.new(array)
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
not_a_mock-1.0.1 lib/not_a_mock/argument_constraint_extensions.rb
not_a_mock-1.0.0 lib/not_a_mock/argument_constraint_extensions.rb