class VariableMatcher
Attributes
description[RW]
variables_method[RW]
Public Class Methods
new(variable)
click to toggle source
# File lib/mspec/matchers/variable.rb, line 10 def initialize(variable) @variable = convert_name(variable) end
Public Instance Methods
failure_message()
click to toggle source
# File lib/mspec/matchers/variable.rb, line 19 def failure_message ["Expected #{@object} to have #{self.class.description} '#{@variable}'", "but it does not"] end
matches?(object)
click to toggle source
# File lib/mspec/matchers/variable.rb, line 14 def matches?(object) @object = object @object.send(self.class.variables_method).include? @variable end
negative_failure_message()
click to toggle source
# File lib/mspec/matchers/variable.rb, line 24 def negative_failure_message ["Expected #{@object} NOT to have #{self.class.description} '#{@variable}'", "but it does"] end