class BeAncestorOfMatcher
Public Class Methods
new(expected)
click to toggle source
# File lib/mspec/matchers/be_ancestor_of.rb, line 2 def initialize(expected) @expected = expected end
Public Instance Methods
failure_message()
click to toggle source
# File lib/mspec/matchers/be_ancestor_of.rb, line 11 def failure_message ["Expected #{@actual}", "to be an ancestor of #{@expected}"] end
matches?(actual)
click to toggle source
# File lib/mspec/matchers/be_ancestor_of.rb, line 6 def matches?(actual) @actual = actual @expected.ancestors.include? @actual end
negative_failure_message()
click to toggle source
# File lib/mspec/matchers/be_ancestor_of.rb, line 15 def negative_failure_message ["Expected #{@actual}", "not to be an ancestor of #{@expected}"] end