module RSpec::Matchers

def have(n)

expect("this string").to have(11).characters #"characters" is pure sugar
# Passes if "this string".length == 11

expect([1,2,3]).to have(3).items #"items" is pure sugar
# Passes if ['a', 'b', 'c'].count == 3

expect([1,2,3]).to have(3).items #"items" is pure sugar
# Passes if [1,2,3].length == 3

expect(team).to have(11).players
# Passes if team.players.size == 11

@example

lengths.
This also works for Strings, letting you set expectations about their

collection.
"items" as these are all standard ways of describing the things IN a
`named_collection`. We'd recommend using either "elements", "members", or
If the receiver IS the collection, you can use any name you like for

you must use that name to set the expectation.
collection. So if a `Team` instance has a collection named `#players`,
If the receiver OWNS the collection, you must use the name of the

if the receiver OWNS a collection with the submitted number of items.
Passes if receiver is a collection with the submitted number of items OR
def have(n)
  BuiltIn::Have.new(n)
end