Class/Module Index [+]

Quicksearch

RSpec::Matchers::BuiltIn::ContainExactly

@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 31
def description
  "contain exactly#{to_sentence(surface_descriptions_in expected)}"
end
failure_message() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/contain_exactly.rb, line 10
def failure_message
  if Array === actual
    message  = "expected collection contained:  #{safe_sort(surface_descriptions_in expected).inspect}\n"
    message += "actual collection contained:    #{safe_sort(actual).inspect}\n"
    message += "the missing elements were:      #{safe_sort(surface_descriptions_in missing_items).inspect}\n" unless missing_items.empty?
    message += "the extra elements were:        #{safe_sort(extra_items).inspect}\n" unless extra_items.empty?
    message
  else
    "expected a collection that can be converted to an array with "              "`#to_ary` or `#to_a`, but got #{actual.inspect}"
  end
end
failure_message_when_negated() click to toggle source

@api private @return [String]

# File lib/rspec/matchers/built_in/contain_exactly.rb, line 25
def failure_message_when_negated
  "`contain_exactly` does not support negation"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.