Class: Mocktail::FulfillsStubbing
- Inherits:
-
Object
- Object
- Mocktail::FulfillsStubbing
- Extended by:
- T::Sig
- Defined in:
- lib/mocktail/handles_dry_call/fulfills_stubbing.rb,
lib/mocktail/sorbet/mocktail/handles_dry_call/fulfills_stubbing.rb
Instance Method Summary collapse
- #fulfill(dry_call) ⇒ Object
-
#initialize ⇒ FulfillsStubbing
constructor
A new instance of FulfillsStubbing.
- #satisfaction(dry_call) ⇒ Object
Constructor Details
#initialize ⇒ FulfillsStubbing
Returns a new instance of FulfillsStubbing.
8 9 10 11 |
# File 'lib/mocktail/handles_dry_call/fulfills_stubbing.rb', line 8 def initialize @finds_satisfaction = FindsSatisfaction.new @describes_unsatisfied_stubbing = DescribesUnsatisfiedStubbing.new end |
Instance Method Details
#fulfill(dry_call) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/mocktail/handles_dry_call/fulfills_stubbing.rb', line 13 def fulfill(dry_call) if (stubbing = satisfaction(dry_call)) stubbing.satisfied! stubbing.effect&.call(dry_call) else (dry_call) nil end end |