class RSpec::Matchers::BuiltIn::ContainExactly

rubocop:disable ClassLength @api private Provides the implementation for `contain_exactly` and `match_array`. Not intended to be instantiated directly.

Public Instance Methods

description() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/contain_exactly.rb, line 29
def description
  list = EnglishPhrasing.list(surface_descriptions_in(expected))
  "contain exactly#{list}"
end
failure_message() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/contain_exactly.rb, line 11
def failure_message
  if Array === actual
    generate_failure_message
  else
    "expected a collection that can be converted to an array with "              "`#to_ary` or `#to_a`, but got #{actual_formatted}"
  end
end
failure_message_when_negated() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/contain_exactly.rb, line 22
def failure_message_when_negated
  list = EnglishPhrasing.list(surface_descriptions_in(expected))
  "expected #{actual_formatted} not to contain exactly#{list}"
end