Sha256: decbd9c877e0c8e8d840339f53488f2a458c70ae8a2d04b6c70ed3b0c6f5ea62

Contents?: true

Size: 771 Bytes

Versions: 21

Compression:

Stored size: 771 Bytes

Contents

module WildcardMatcherMatchers
  extend RSpec::Matchers::DSL

  matcher :equal_match do |value|
    match { |matcher|
      matcher == value &&
      matcher.eql?(value)
    }

    failure_message_for_should {
      "Expected matcher to equal match #{value.inspect}, but it didn't"
    }

    failure_message_for_should_not {
      "Expected matcher to not equal match #{value.inspect}, but it did"
    }
  end

  matcher :wildcard_match do |value|
    match { |matcher|
      matcher.wildcard_match?(value)
    }

    failure_message_for_should {
      "Expected matcher to wildcard equal match #{value.inspect}, but it didn't"
    }

    failure_message_for_should_not {
      "Expected matcher to not wildcard equal match #{value.inspect}, but it did"
    }
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
rr-3.1.1 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.1.0 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.9 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.8 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.7 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.6 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.5 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.4 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.3 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.2 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.1 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-3.0.0 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.2.1 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.2.0 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.2 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.2.rc1 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.1.rc1 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.0 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.0.rc3 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb
rr-1.1.0.rc2 spec/suites/rspec_2/support/matchers/wildcard_matcher_matchers.rb