Class: Servactory::TestKit::Rspec::Matchers::Submatchers::Input::OptionalSubmatcher
- Inherits:
-
Base::Submatcher
- Object
- Base::Submatcher
- Servactory::TestKit::Rspec::Matchers::Submatchers::Input::OptionalSubmatcher
- Defined in:
- lib/servactory/test_kit/rspec/matchers/submatchers/input/optional_submatcher.rb
Overview
Submatcher for validating that an input is optional.
## Purpose
Validates that a service input has ‘required: false` option set, meaning the input can be omitted when calling the service.
## Usage
“‘ruby it { is_expected.to have_service_input(:nickname).optional } it { is_expected.to have_service_input(:description).optional } “`
## Note
Mutually exclusive with ‘required` submatcher - only one can be used per matcher chain.
Instance Attribute Summary
Attributes inherited from Base::Submatcher
Instance Method Summary collapse
-
#description ⇒ String
Returns description for RSpec output.
Methods inherited from Base::Submatcher
#failure_message, #failure_message_when_negated, #initialize, #matches?
Methods included from Concerns::ValueComparison
Methods included from Concerns::ErrorMessageBuilder
Methods included from Concerns::AttributeDataAccess
Constructor Details
This class inherits a constructor from Servactory::TestKit::Rspec::Matchers::Base::Submatcher
Instance Method Details
#description ⇒ String
Returns description for RSpec output.
31 32 33 |
# File 'lib/servactory/test_kit/rspec/matchers/submatchers/input/optional_submatcher.rb', line 31 def description "required: false" end |