Class: Mocktail::RegistersStubbing

Inherits:
Object
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/mocktail/registers_stubbing.rb,
lib/mocktail/sorbet/mocktail/registers_stubbing.rb

Instance Method Summary collapse

Constructor Details

#initializeRegistersStubbing

Returns a new instance of RegistersStubbing.



7
8
9
# File 'lib/mocktail/registers_stubbing.rb', line 7

def initialize
  @records_demonstration = RecordsDemonstration.new
end

Instance Method Details

#register(demonstration, demo_config) ⇒ Object



11
12
13
14
15
16
17
18
19
# File 'lib/mocktail/registers_stubbing.rb', line 11

def register(demonstration, demo_config)
  Stubbing.new(
    demonstration: demonstration,
    demo_config: demo_config,
    recording: @records_demonstration.record(demonstration, demo_config)
  ).tap do |stubbing|
    Mocktail.cabinet.store_stubbing(stubbing)
  end
end