Class: RSpec::Matchers::BuiltIn::Include
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::Include
- Defined in:
- lib/rspec/matchers/built_in/include.rb
Instance Attribute Summary
Attributes inherited from BaseMatcher
#actual, #expected, #rescued_exception
Instance Method Summary collapse
- #description ⇒ Object
- #diffable? ⇒ Boolean
- #does_not_match?(actual) ⇒ Boolean
-
#initialize(*expected) ⇒ Include
constructor
A new instance of Include.
- #matches?(actual) ⇒ Boolean
Methods inherited from BaseMatcher
#==, #failure_message_for_should, #failure_message_for_should_not, #match_unless_raises
Methods included from Pretty
#_pretty_print, #expected_to_sentence, #name, #name_to_sentence, #split_words, #to_sentence, #underscore
Constructor Details
#initialize(*expected) ⇒ Include
Returns a new instance of Include.
5 6 7 |
# File 'lib/rspec/matchers/built_in/include.rb', line 5 def initialize(*expected) @expected = expected end |
Instance Method Details
#description ⇒ Object
19 20 21 |
# File 'lib/rspec/matchers/built_in/include.rb', line 19 def description "include#{expected_to_sentence}" end |
#diffable? ⇒ Boolean
23 24 25 |
# File 'lib/rspec/matchers/built_in/include.rb', line 23 def diffable? true end |
#does_not_match?(actual) ⇒ Boolean
14 15 16 17 |
# File 'lib/rspec/matchers/built_in/include.rb', line 14 def does_not_match?(actual) @actual = actual perform_match(:none?, :any?, @actual, @expected) end |
#matches?(actual) ⇒ Boolean
9 10 11 12 |
# File 'lib/rspec/matchers/built_in/include.rb', line 9 def matches?(actual) @actual = actual perform_match(:all?, :all?, @actual, @expected) end |