Sha256: 85ad33401593d7af956f9bfa69a14f6776e561d1db008649267c14424ef483e2

Contents?: true

Size: 694 Bytes

Versions: 54

Compression:

Stored size: 694 Bytes

Contents

module Micronaut
  module Matchers
    
    # :call-seq:
    #   should match(regexp)
    #   should_not match(regexp)
    #
    # Given a Regexp, passes if actual =~ regexp
    #
    # == Examples
    #
    #   email.should match(/^([^\s]+)((?:[-a-z0-9]+\.)+[a-z]{2,})$/i)
    def match(regexp)
      simple_matcher do |actual, matcher|
        matcher.failure_message          = "expected #{actual.inspect} to match #{regexp.inspect}", regexp, actual
        matcher.negative_failure_message = "expected #{actual.inspect} not to match #{regexp.inspect}", regexp, actual
        matcher.description              = "match #{regexp.inspect}"
        actual =~ regexp
      end
    end
  end
end

Version data entries

54 entries across 54 versions & 3 rubygems

Version Path
rsanheim-micronaut-0.1.3.2 lib/micronaut/matchers/match.rb
rsanheim-micronaut-0.1.4.1 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.3 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.4 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.5 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.6 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.7 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.0.9 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.0 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.1 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.2 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.3 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.4.1 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.4.2 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.4.3 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.4.4 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.4 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.5.2 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.5 lib/micronaut/matchers/match.rb
spicycode-micronaut-0.1.6.1 lib/micronaut/matchers/match.rb