Method: RSpec::Matchers#contain_exactly

Defined in:
lib/rspec/matchers.rb

#contain_exactly(*items) ⇒ Object Also known as: a_collection_containing_exactly, containing_exactly

Note:

This is also available using the =~ operator with should, but =~ is not supported with expect.

Passes if actual contains all of the expected regardless of order. This works for collections. Pass in multiple args and it will only pass if all args are found in collection.

Examples:

expect([1, 2, 3]).to contain_exactly(1, 2, 3)
expect([1, 2, 3]).to contain_exactly(1, 3, 2)

See Also:



510
511
512
# File 'lib/rspec/matchers.rb', line 510

def contain_exactly(*items)
  BuiltIn::ContainExactly.new(items)
end