Class: RSpec::JsonMatchers::Expectations::Core::SingleValueCallableExpectation Abstract
- Inherits:
-
CallableExpectation
- Object
- RSpec::JsonMatchers::Expectation
- CallableExpectation
- RSpec::JsonMatchers::Expectations::Core::SingleValueCallableExpectation
- Defined in:
- lib/rspec/json_matchers/expectations/core.rb
Overview
This class is abstract.
Validates exactly one value is passed in
Direct Known Subclasses
Mixins::BuiltIn::ArrayOf, Mixins::BuiltIn::HashWithContent, Private::Eq, Private::InRange, Private::KindOf, Private::MatchingRegexp, Private::SatisfyingCallable
Class Method Summary collapse
-
.[](*values) ⇒ Expectation
The replacement of new It accept any number of arguments and delegates to private new This pattern is taken from gem
contracts.
Methods inherited from RSpec::JsonMatchers::Expectation
Class Method Details
.[](*values) ⇒ Expectation
The replacement of new It accept any number of arguments and delegates to private new This pattern is taken from gem contracts
But only 1 argument is accepted
72 73 74 75 76 77 78 79 80 |
# File 'lib/rspec/json_matchers/expectations/core.rb', line 72 def self.[](*values) unless values.size == EXPECTED_VALUE_SIZE fail( ArgumentError, "Exactly #{EXPECTED_VALUE_SIZE} argument is required", ) end super end |