Sha256: a22af1cfd653add9998e8cf11cdaa50e6b068b3c0ddcf8e0bae3664f7044744e
Contents?: true
Size: 451 Bytes
Versions: 6
Compression:
Stored size: 451 Bytes
Contents
Spec::Matchers.define :smart_match do |expected| def regexp? /^\/.*\/?$/ end def quoted? /^".*"$/ end match do |actual| case expected when regexp? actual =~ eval(expected) when quoted? actual.index(eval(expected)) else # multi-line string actual.index(expected) end end failure_message_for_should do |actual| <<-MESSAGE #{'*'*50} got: #{'*'*30} #{actual} #{'*'*50} MESSAGE end end
Version data entries
6 entries across 6 versions & 3 rubygems