Exception: RSpec::Expectations::MultipleExpectationsNotMetError

Inherits:
ExpectationNotMetError show all
Defined in:
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations.rb,
lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb

Overview

Exception raised from ‘aggregate_failures` when multiple expectations fail.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Exception

#as_json

Instance Attribute Details

#all_exceptionsArray<Exception> (readonly)

Returns The list of expectation failures and other exceptions, combined.

Returns:

  • (Array<Exception>)

    The list of expectation failures and other exceptions, combined.



125
126
127
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 125

def all_exceptions
  @all_exceptions
end

Instance Method Details

#aggregation_block_labelString

Returns The user-assigned label for the aggregation block.

Returns:

  • (String)

    The user-assigned label for the aggregation block.



128
129
130
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 128

def aggregation_block_label
  @failure_aggregator.block_label
end

#aggregation_metadataHash

Returns The metadata hash passed to ‘aggregate_failures`.

Returns:

  • (Hash)

    The metadata hash passed to ‘aggregate_failures`.



133
134
135
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 133

def 
  @failure_aggregator.
end

#exception_count_descriptionObject

return [String] A description of the failure/error counts.



144
145
146
147
148
149
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 144

def exception_count_description
  failure_count = pluralize("failure", failures.size)
  return failure_count if other_errors.empty?
  error_count = pluralize("other error", other_errors.size)
  "#{failure_count} and #{error_count}"
end

#failuresArray<RSpec::Expectations::ExpectationNotMetError>

Returns The list of expectation failures.

Returns:



115
116
117
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 115

def failures
  @failure_aggregator.failures
end

#messageString

Returns The fully formatted exception message.

Returns:

  • (String)

    The fully formatted exception message.



110
111
112
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 110

def message
  @message ||= (["#{summary}:"] + enumerated_failures + enumerated_errors).join("\n\n")
end

#other_errorsArray<Exception>

Returns The list of other exceptions.

Returns:



120
121
122
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 120

def other_errors
  @failure_aggregator.other_errors
end

#summaryString

Returns A summary of the failure, including the block label and a count of failures.

Returns:

  • (String)

    A summary of the failure, including the block label and a count of failures.



138
139
140
141
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/rspec-expectations-3.12.2/lib/rspec/expectations/failure_aggregator.rb', line 138

def summary
  "Got #{exception_count_description} from failure aggregation " \
  "block#{block_description}"
end