@api private Provides the implementation for `contain_exactly` and `match_array`. Not intended to be instantiated directly.
@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
@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
Generated with the Darkfish Rdoc Generator 2.