Sha256: 292ddd9ab56931b20533fc036512651bfd91eb6106b08bef4fcdb0661939e7c1

Contents?: true

Size: 689 Bytes

Versions: 18

Compression:

Stored size: 689 Bytes

Contents

module Spec
  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

18 entries across 18 versions & 6 rubygems

Version Path
dchelimsky-rspec-1.1.11.1 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.2 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.3 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.4 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.5 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.6 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.11.7 lib/spec/matchers/match.rb
dchelimsky-rspec-1.1.12 lib/spec/matchers/match.rb
newbamboo-evented-rspec-1.1.12 lib/spec/matchers/match.rb
newbamboo-rspec-1.1.12 lib/spec/matchers/match.rb
mack-0.8.3.1 lib/gems/rspec-1.1.12/lib/spec/matchers/match.rb
mack-0.8.3 lib/gems/rspec-1.1.12/lib/spec/matchers/match.rb
rspec-1.1.12 lib/spec/matchers/match.rb
spree-0.6.0 vendor/plugins/rspec/lib/spec/matchers/match.rb
spree-0.7.0 vendor/plugins/rspec/lib/spec/matchers/match.rb
spree-0.7.1 vendor/plugins/rspec/lib/spec/matchers/match.rb
spree-0.8.0 vendor/plugins/rspec/lib/spec/matchers/match.rb
spree-0.8.1 vendor/plugins/rspec/lib/spec/matchers/match.rb