Class: RSpec::Expectations::MultipleExpectationsNotMetError

### Home Classes Methods

### In Files

- lib/rspec/expectations.rb
- lib/rspec/expectations/failure_aggregator.rb

### Parent

RSpec::Expectations::ExpectationNotMetError

### Methods

- ::new
- #aggregation_block_label
- #aggregation_metadata
- #exception_count_description
- #failures
- #message
- #other_errors
- #summary

### Class/Module Index

Quicksearch

- RSpec
- RSpec::Expectations
- RSpec::Expectations::BlockExpectationTarget
- RSpec::Expectations::Configuration
- RSpec::Expectations::ExpectationHelper
- RSpec::Expectations::ExpectationNotMetError
- RSpec::Expectations::ExpectationTarget
- RSpec::Expectations::FailureAggregator
- RSpec::Expectations::LegacyMacherAdapter
- RSpec::Expectations::LegacyMatcherAdapter
- RSpec::Expectations::LegacyMatcherAdapter::RSpec1
- RSpec::Expectations::LegacyMatcherAdapter::RSpec2
- RSpec::Expectations::MultipleExpectationsNotMetError
- RSpec::Expectations::NegativeExpectationHandler
- RSpec::Expectations::PositiveExpectationHandler
- RSpec::Expectations::Syntax
- RSpec::Expectations::Version
- RSpec::Matchers
- RSpec::Matchers::AliasedMatcher
- RSpec::Matchers::AliasedMatcherWithOperatorSupport
- RSpec::Matchers::AliasedNegatedMatcher
- RSpec::Matchers::BuiltIn
- RSpec::Matchers::BuiltIn::All
- RSpec::Matchers::BuiltIn::BaseMatcher
- RSpec::Matchers::BuiltIn::BaseMatcher::DefaultFailureMessages
- RSpec::Matchers::BuiltIn::BaseMatcher::HashFormatting
- RSpec::Matchers::BuiltIn::Be
- RSpec::Matchers::BuiltIn::BeAKindOf
- RSpec::Matchers::BuiltIn::BeAnInstanceOf
- RSpec::Matchers::BuiltIn::BeBetween
- RSpec::Matchers::BuiltIn::BeComparedTo
- RSpec::Matchers::BuiltIn::BeFalsey
- RSpec::Matchers::BuiltIn::BeHelpers
- RSpec::Matchers::BuiltIn::BeNil
- RSpec::Matchers::BuiltIn::BePredicate
- RSpec::Matchers::BuiltIn::BeTruthy
- RSpec::Matchers::BuiltIn::BeWithin
- RSpec::Matchers::BuiltIn::CaptureStderr
- RSpec::Matchers::BuiltIn::CaptureStdout
- RSpec::Matchers::BuiltIn::CaptureStreamToTempfile
- RSpec::Matchers::BuiltIn::Change
- RSpec::Matchers::BuiltIn::ChangeDetails
- RSpec::Matchers::BuiltIn::ChangeFromValue
- RSpec::Matchers::BuiltIn::ChangeRelatively
- RSpec::Matchers::BuiltIn::ChangeToValue
- RSpec::Matchers::BuiltIn::Compound
- RSpec::Matchers::BuiltIn::Compound::And
- RSpec::Matchers::BuiltIn::Compound::NestedEvaluator
- RSpec::Matchers::BuiltIn::Compound::Or
- RSpec::Matchers::BuiltIn::Compound::SequentialEvaluator
- RSpec::Matchers::BuiltIn::ContainExactly
- RSpec::Matchers::BuiltIn::ContainExactly::PairingsMaximizer
- RSpec::Matchers::BuiltIn::Cover
- RSpec::Matchers::BuiltIn::EndWith
- RSpec::Matchers::BuiltIn::Eq
- RSpec::Matchers::BuiltIn::Eql
- RSpec::Matchers::BuiltIn::Equal
- RSpec::Matchers::BuiltIn::Exist
- RSpec::Matchers::BuiltIn::Exist::ExistenceTest
- RSpec::Matchers::BuiltIn::Has
- RSpec::Matchers::BuiltIn::HaveAttributes
- RSpec::Matchers::BuiltIn::Include
- RSpec::Matchers::BuiltIn::Match
- RSpec::Matchers::BuiltIn::NegativeOperatorMatcher
- RSpec::Matchers::BuiltIn::NullCapture
- RSpec::Matchers::BuiltIn::OperatorMatcher
- RSpec::Matchers::BuiltIn::Output
- RSpec::Matchers::BuiltIn::PositiveOperatorMatcher
- RSpec::Matchers::BuiltIn::RaiseError
- RSpec::Matchers::BuiltIn::RespondTo
- RSpec::Matchers::BuiltIn::Satisfy
- RSpec::Matchers::BuiltIn::SpecificValuesChange
- RSpec::Matchers::BuiltIn::StartAndEndWith
- RSpec::Matchers::BuiltIn::StartOrEndWith
- RSpec::Matchers::BuiltIn::StartWith
- RSpec::Matchers::BuiltIn::ThrowSymbol
- RSpec::Matchers::BuiltIn::YieldControl
- RSpec::Matchers::BuiltIn::YieldProbe
- RSpec::Matchers::BuiltIn::YieldSuccessiveArgs
- RSpec::Matchers::BuiltIn::YieldWithArgs
- RSpec::Matchers::BuiltIn::YieldWithNoArgs
- RSpec::Matchers::Composable
- RSpec::Matchers::DSL
- RSpec::Matchers::DSL::DefaultImplementations
- RSpec::Matchers::DSL::Macros
- RSpec::Matchers::DSL::Macros::Deprecated
- RSpec::Matchers::DSL::Matcher
- RSpec::Matchers::EnglishPhrasing
- RSpec::Matchers::ExpectedsForMultipleDiffs
- RSpec::Matchers::FailMatchers
- RSpec::Matchers::MatcherDelegator
- RSpec::Matchers::MatcherProtocol
- BasicObject
- Object

No matching classes.

# RSpec::Expectations::MultipleExpectationsNotMetError

Exception raised from `aggregate_failures` when multiple expectations fail.

@note The constant is defined here but the extensive logic of this class

    is lazily defined when `FailureAggregator` is autoloaded, since we do
    not need to waste time defining that functionality unless
    `aggregate_failures` is used.

Exception raised from `aggregate_failures` when multiple expectations fail.

### Attributes

all_exceptions[R]

@return [Array<Exception>] The list of expectation failures and other exceptions, combined.

### Public Class Methods

new(failure_aggregator) click to toggle source

    # File lib/rspec/expectations/failure_aggregator.rb, line 136
    def initialize(failure_aggregator)
      @failure_aggregator = failure_aggregator
      @all_exceptions = failures + other_errors
    end

### Public Instance Methods

aggregation_block_label() click to toggle source

@return [String] The user-assigned label for the aggregation block.

    # File lib/rspec/expectations/failure_aggregator.rb, line 111
    def aggregation_block_label
      @failure_aggregator.block_label
    end

aggregation_metadata() click to toggle source

@return [Hash] The metadata hash passed to `aggregate_failures`.

    # File lib/rspec/expectations/failure_aggregator.rb, line 116
    def aggregation_metadata
      @failure_aggregator.metadata
    end

exception_count_description() click to toggle source

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

    # File lib/rspec/expectations/failure_aggregator.rb, line 127
    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

failures() click to toggle source

@return [Array<RSpec::Expectations::ExpectationNotMetError>] The list of expectation failures.

    # File lib/rspec/expectations/failure_aggregator.rb, line 98
    def failures
      @failure_aggregator.failures
    end

message() click to toggle source

@return [String] The fully formatted exception message.

    # File lib/rspec/expectations/failure_aggregator.rb, line 93
    def message
      @message ||= (["#{summary}:"] + enumerated_failures + enumerated_errors).join("\n\n")
    end

other_errors() click to toggle source

@return [Array<Exception>] The list of other exceptions.

    # File lib/rspec/expectations/failure_aggregator.rb, line 103
    def other_errors
      @failure_aggregator.other_errors
    end

summary() click to toggle source

@return [String] A summary of the failure, including the block label and a count of failures.

    # File lib/rspec/expectations/failure_aggregator.rb, line 121
    def summary
      "Got #{exception_count_description} from failure aggregation "          "block#{block_description}"
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.