Class: RSpec::JsonMatchers::Expectations::Mixins::BuiltIn::AnyOf

Inherits:
Core::CompositeExpectation show all
Defined in:
lib/rspec/json_matchers/expectations/mixins/built_in.rb

Overview

It passes when any of expectation returns true

Direct Known Subclasses

ArrayWithSize, NullableOf

Instance Method Summary collapse

Methods inherited from Core::CompositeExpectation

[]

Methods inherited from Core::CallableExpectation

[]

Methods inherited from RSpec::JsonMatchers::Expectation

build, build_many

Instance Method Details

#expect?(value) ⇒ Boolean

Returns:

  • (Boolean)


116
117
118
119
120
# File 'lib/rspec/json_matchers/expectations/mixins/built_in.rb', line 116

def expect?(value)
  expectations.any? do |expectation|
    expectation.expect?(value)
  end
end