Class: RSpec::Matchers::BuiltIn::All Private
- Inherits:
-
BaseMatcher
- Object
- BaseMatcher
- RSpec::Matchers::BuiltIn::All
- Defined in:
- lib/rspec/matchers/built_in/all.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Provides the implementation for all
.
Not intended to be instantiated directly.
Constant Summary
Constants inherited from BaseMatcher
Instance Method Summary collapse
- #description ⇒ String private
- #failure_message ⇒ String private
-
#initialize(matcher) ⇒ All
constructor
private
A new instance of All.
Methods inherited from BaseMatcher
#diffable?, #expects_call_stack_jump?, #match_unless_raises, #matches?, #supports_block_expectations?
Methods included from BaseMatcher::DefaultFailureMessages
Methods included from Composable
#===, #and, #description_of, #or, should_enumerate?, surface_descriptions_in, unreadable_io?, #values_match?
Constructor Details
#initialize(matcher) ⇒ All
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of All.
11 12 13 14 |
# File 'lib/rspec/matchers/built_in/all.rb', line 11 def initialize(matcher) @matcher = matcher @failed_objects = {} end |
Instance Method Details
#description ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
37 38 39 |
# File 'lib/rspec/matchers/built_in/all.rb', line 37 def description improve_hash_formatting "all #{description_of matcher}" end |
#failure_message ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/rspec/matchers/built_in/all.rb', line 23 def unless iterable? return "#{improve_hash_formatting(super)}, but was not iterable" end = [improve_hash_formatting(super)] failed_objects.each do |index, | << (index, ) end .join("\n\n") end |