Sha256: f8982f1a80b2aa09a04de2bfe66e933839fa6b689f3ffab8b6a578b6ed588162
Contents?: true
Size: 874 Bytes
Versions: 9
Compression:
Stored size: 874 Bytes
Contents
module Spec module Matchers class Match def initialize(expected) @expected = expected end def matches?(actual) @actual = actual actual =~ @expected end def failure_message return "expected #{@actual.inspect} to match #{@expected.inspect}", @expected, @actual end def negative_failure_message return "expected #{@actual.inspect} not to match #{@expected.inspect}", @expected, @actual end def description "match #{@expected.inspect}" end end # :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(expected) Match.new(expected) end end end
Version data entries
9 entries across 9 versions & 1 rubygems