Passes if receiver is a collection with the submitted number of items OR if the receiver OWNS a collection with the submitted number of items.
If the receiver OWNS the collection, you must use the name of the collection. So if a Team instance has a collection named #players, you must use that name to set the expectation.
If the receiver IS the collection, you can use any name you like for named_collection. We’d recommend using either "elements", "members", or "items" as these are all standard ways of describing the things IN a collection.
This also works for Strings, letting you set an expectation about its length
# File lib/spec/matchers/have.rb, line 124 def have(n) Matchers::Have.new(n) end