class RSpec::Matchers::BuiltIn::All
@api private Provides the implementation for ‘all`. Not intended to be instantiated directly.
Attributes
@private
@private
Public Class Methods
# File rspec-expectations/lib/rspec/matchers/built_in/all.rb, line 11 def initialize(matcher) @matcher = matcher @failed_objects = {} end
Public Instance Methods
@api private @return [String]
# File rspec-expectations/lib/rspec/matchers/built_in/all.rb, line 37 def description improve_hash_formatting "all #{description_of matcher}" end
@private
# File rspec-expectations/lib/rspec/matchers/built_in/all.rb, line 17 def does_not_match?(_actual) raise NotImplementedError, '`expect().not_to all( matcher )` is not supported.' end
@api private @return [String]
Calls superclass method
# File rspec-expectations/lib/rspec/matchers/built_in/all.rb, line 23 def failure_message unless iterable? return "#{improve_hash_formatting(super)}, but was not iterable" end all_messages = [improve_hash_formatting(super)] failed_objects.each do |index, matcher_failure_message| all_messages << failure_message_for_item(index, matcher_failure_message) end all_messages.join("\n\n") end