Class: Spec::Matchers::Include
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(expected) ⇒ Include
constructor
A new instance of Include.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(expected) ⇒ Include
Returns a new instance of Include.
6 7 8 |
# File 'lib/spec/matchers/include.rb', line 6 def initialize(expected) @expected = expected end |
Instance Method Details
#description ⇒ Object
23 24 25 |
# File 'lib/spec/matchers/include.rb', line 23 def description "include #{@expected.inspect}" end |
#failure_message ⇒ Object
15 16 17 |
# File 'lib/spec/matchers/include.rb', line 15 def end |
#matches?(actual) ⇒ Boolean
10 11 12 13 |
# File 'lib/spec/matchers/include.rb', line 10 def matches?(actual) @actual = actual actual.include?(@expected) end |
#negative_failure_message ⇒ Object
19 20 21 |
# File 'lib/spec/matchers/include.rb', line 19 def ("not ") end |