module RSpec::Matchers
def be(*args)
(e.g. be_empty), letting you choose the prefix that best suits the
"be_an_" (e.g. be_an_instance_of), "be_a_" (e.g. be_a_kind_of) or "be_"
The arbitrary_predicate feature will handle any predicate prefixed with
RSpec will match convert that into a query against the target object.
false. Given be_ followed by arbitrary_predicate (without the "?"),
Predicates are any Ruby method that ends in a "?" and returns true or
condition (to be or not to be).
nil (respectively). Given no args means the caller should satisfy an if
Given true, false, or nil, will pass if actual value is true, false or
expect(actual).not_to be_[arbitrary_predicate](*args)
expect(actual).not_to be_nil
expect(actual).to be_[arbitrary_predicate](*args)
expect(actual).to be_nil
expect(actual).to be_falsey
expect(actual).to be_truthy
@example
def be(*args) args.empty? ? Matchers::BuiltIn::Be.new : equal(*args) end