Sha256: f616ceaafc030e4916844e4e5912c70c084239ea9c58d1e191e62f164d141507

Contents?: true

Size: 546 Bytes

Versions: 59

Compression:

Stored size: 546 Bytes

Contents

module RR
  module WildcardMatchers
    class Satisfy
      attr_reader :expectation_proc

      def initialize(expectation_proc)
        @expectation_proc = expectation_proc
      end

      def wildcard_match?(other)
        return true if self == other
        !!expectation_proc.call(other)
      end

      def inspect
        "satisfy {block}"
      end

      def ==(other)
        return false unless other.is_a?(self.class)
        self.expectation_proc == other.expectation_proc
      end
      alias_method :eql?, :==
    end
  end
end

Version data entries

59 entries across 55 versions & 9 rubygems

Version Path
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.3 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.3/vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/bitclust-core-0.5.1/vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.2 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
bitclust-core-0.5.1 vendor/bundle/ruby/1.9.1/gems/rr-1.0.4/lib/rr/wildcard_matchers/satisfy.rb
mcmire-rr-1.0.5.rc1 lib/rr/wildcard_matchers/satisfy.rb
messagebus_ruby_api-0.4.7 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
messagebus_ruby_api-0.4.4 spec/ruby/1.9.1/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
rr-1.0.4 lib/rr/wildcard_matchers/satisfy.rb
rr-1.0.3 lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.1.2.0001 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.1.2 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.1.1 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.1.0 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.0.3 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.0.2 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
vim-jar-0.0.1 bundler/ruby/1.8/gems/rr-1.0.2/lib/rr/wildcard_matchers/satisfy.rb
rr-1.0.2 lib/rr/wildcard_matchers/satisfy.rb