Method: RSpec::Matchers#all

Defined in:
lib/rspec/matchers.rb

#all(expected) ⇒ Object

Note:

The negative form not_to all is not supported. Instead use not_to include or pass a negative form of a matcher as the argument (e.g. all exclude(:foo)).

Note:

You can also use this with compound matchers as well.

Passes if the provided matcher passes when checked against all elements of the collection.

Examples:

expect([1, 3, 5]).to all be_odd
expect([1, 3, 6]).to all be_odd # fails
expect([1, 3, 5]).to all( be_odd.and be_an(Integer) )


662
663
664
# File 'lib/rspec/matchers.rb', line 662

def all(expected)
  BuiltIn::All.new(expected)
end