class BaconExpect::Matcher::EndWith
Public Class Methods
new(end_string)
click to toggle source
# File lib/bacon-expect/matchers/end_with.rb, line 3 def initialize(end_string) @end_string = end_string end
Public Instance Methods
fail!(subject, negated)
click to toggle source
# File lib/bacon-expect/matchers/end_with.rb, line 11 def fail!(subject, negated) raise FailedExpectation.new(FailMessageRenderer.message_for_end_with(negated, subject, @end_string)) end
matches?(subject)
click to toggle source
# File lib/bacon-expect/matchers/end_with.rb, line 7 def matches?(subject) subject[-@end_string.size..-1] == @end_string end