class Appydays::SpecHelpers::HaveALineMatching
Public Class Methods
new(regexp)
click to toggle source
# File lib/appydays/spec_helpers.rb, line 22 def initialize(regexp) @regexp = regexp end
Public Instance Methods
failure_message()
click to toggle source
# File lib/appydays/spec_helpers.rb, line 33 def failure_message return "expected %p to have at least one line matching %p" % [@target, @regexp] end
Also aliased as: failure_message_for_should
failure_message_when_negated()
click to toggle source
# File lib/appydays/spec_helpers.rb, line 39 def failure_message_when_negated return "expected %p not to have any lines matching %p, but it has at least one" % [@target, @regexp] end
Also aliased as: failure_message_for_should_not
matches?(target)
click to toggle source
# File lib/appydays/spec_helpers.rb, line 26 def matches?(target) @target = target return @target.find do |obj| obj.to_s.match(@regexp) end end