Module: RSpec::Matchers

Included in:
Aruba::Api::Core, Aruba::Matchers
Defined in:
lib/aruba/matchers/collection/include_an_object.rb

Instance Method Summary collapse

Instance Method Details

#include_an_object(expected) ⇒ Object

Note:

You can also use this with compound matchers as well.

Passes if the provided matcher passes when checked against any element of the collection.

Examples:

expect([1, 4, 5]).to include_an_object be_odd
expect([1, 4, 'a']).to include_an_object( be_odd.and be_an(Integer) )


118
119
120
# File 'lib/aruba/matchers/collection/include_an_object.rb', line 118

def include_an_object(expected)
  ::Aruba::Matchers::IncludeAnObject.new(expected)
end