Sha256: 26935b6f7d12017446413a8a5cfceb3346e6229e8a846e33a1ca76b156668fc5

Contents?: true

Size: 351 Bytes

Versions: 8

Compression:

Stored size: 351 Bytes

Contents

require "rspec"
require "wildcard_matchers"

RSpec.configure do |c|
  c.include WildcardMatchers
end

RSpec::Matchers.define :wildcard_match do |expected|
  match do |actual|
    @matcher = WildcardMatchers::WildcardMatcher.new(expected)
    @matcher === actual
  end

  failure_message_for_should do |actual|
    @matcher.errors.join("\n")
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
wildcard_matchers-0.1.7 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.6 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.5 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.4 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.3 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.2 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.1 lib/wildcard_matchers/rspec.rb
wildcard_matchers-0.1.0 lib/wildcard_matchers/rspec.rb