Class: Pancake::Test::Matchers::InheritFrom
- Defined in:
- lib/pancake/test/matchers.rb
Instance Method Summary collapse
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ InheritFrom
constructor
A new instance of InheritFrom.
- #matches?(target) ⇒ Boolean
Constructor Details
#initialize(expected) ⇒ InheritFrom
Returns a new instance of InheritFrom.
39 40 41 |
# File 'lib/pancake/test/matchers.rb', line 39 def initialize(expected) @expected = expected end |
Instance Method Details
#failure_message ⇒ Object
48 49 50 |
# File 'lib/pancake/test/matchers.rb', line 48 def "expected #{@target} to inherit from #{@expected} but did not" end |
#matches?(target) ⇒ Boolean
43 44 45 46 |
# File 'lib/pancake/test/matchers.rb', line 43 def matches?(target) @target = target @target.ancestors.include?(@expected) end |