Module: Phlex::Sorbet::RSpec::Matchers
- Defined in:
- lib/phlex/sorbet/rspec/matchers.rb
Overview
Custom RSpec matchers for validating Phlex::Sorbet component prop types
Defined Under Namespace
Classes: AcceptProps, HaveProp, HaveProps, RejectProps
Instance Method Summary collapse
- #accept_props(props) ⇒ Object
-
#have_prop(field_name, expected_type = nil) ⇒ Object
DSL methods to create matcher instances.
- #have_props(args_hash_or_field = nil, expected_type = nil) ⇒ Object
- #reject_props(props) ⇒ Object
Instance Method Details
#accept_props(props) ⇒ Object
272 273 274 |
# File 'lib/phlex/sorbet/rspec/matchers.rb', line 272 def accept_props(props) AcceptProps.new(props) end |
#have_prop(field_name, expected_type = nil) ⇒ Object
DSL methods to create matcher instances
264 265 266 |
# File 'lib/phlex/sorbet/rspec/matchers.rb', line 264 def have_prop(field_name, expected_type = nil) HaveProp.new(field_name, expected_type) end |
#have_props(args_hash_or_field = nil, expected_type = nil) ⇒ Object
268 269 270 |
# File 'lib/phlex/sorbet/rspec/matchers.rb', line 268 def have_props(args_hash_or_field = nil, expected_type = nil) HaveProps.new(args_hash_or_field, expected_type) end |
#reject_props(props) ⇒ Object
276 277 278 |
# File 'lib/phlex/sorbet/rspec/matchers.rb', line 276 def reject_props(props) RejectProps.new(props) end |