class Mongomatic::Expectations::Match
Public Class Methods
name()
click to toggle source
# File lib/mongomatic/expectations/match.rb, line 4 def self.name "match" end
Public Instance Methods
to_be()
click to toggle source
# File lib/mongomatic/expectations/match.rb, line 8 def to_be return true if opts[:allow_nil] && value.nil? add_error_msg unless opts[:with].match(value.to_s) end
to_not_be()
click to toggle source
# File lib/mongomatic/expectations/match.rb, line 14 def to_not_be add_error_msg if opts[:with].match(value.to_s) end