Sha256: 4dab9be643f26c698e341b5dc66dcaa6eee152f2e1260a18962d3716147f6947
Contents?: true
Size: 414 Bytes
Versions: 20
Compression:
Stored size: 414 Bytes
Contents
class PhraseMatcher def initialize(string) @string = string @pattern = /\b#{Regexp.escape string}\b/ end def matches?(actual) @actual = actual.to_s @actual =~ @pattern end def failure_message "expected #{@actual.inspect} to contain phrase #{@string.inspect}" end def negative_failure_message "expected #{@actual.inspect} not to contain phrase #{@string.inspect}" end end
Version data entries
20 entries across 20 versions & 2 rubygems