Class: Spec::Matchers::Include
Overview
:nodoc:
Instance Method Summary collapse
- #description ⇒ Object
- #failure_message ⇒ Object
-
#initialize(*expecteds) ⇒ Include
constructor
A new instance of Include.
- #matches?(actual) ⇒ Boolean
- #negative_failure_message ⇒ Object
Constructor Details
#initialize(*expecteds) ⇒ Include
Returns a new instance of Include.
6 7 8 |
# File 'lib/spec/matchers/include.rb', line 6 def initialize(*expecteds) @expecteds = expecteds end |
Instance Method Details
#description ⇒ Object
26 27 28 |
# File 'lib/spec/matchers/include.rb', line 26 def description "include #{_pretty_print(@expecteds)}" end |
#failure_message ⇒ Object
18 19 20 |
# File 'lib/spec/matchers/include.rb', line 18 def end |
#matches?(actual) ⇒ Boolean
10 11 12 13 14 15 16 |
# File 'lib/spec/matchers/include.rb', line 10 def matches?(actual) @actual = actual @expecteds.each do |expected| return false unless actual.include?(expected) end true end |
#negative_failure_message ⇒ Object
22 23 24 |
# File 'lib/spec/matchers/include.rb', line 22 def ("not ") end |