Class: Sequent::Test::WorkflowHelpers::FakeTransactionProvider

Inherits:
Object
  • Object
show all
Defined in:
lib/sequent/test/event_handler_helpers.rb

Instance Method Summary collapse

Constructor Details

#initializeFakeTransactionProvider

Returns a new instance of FakeTransactionProvider.



31
32
33
# File 'lib/sequent/test/event_handler_helpers.rb', line 31

def initialize
  @after_commit_blocks = []
end

Instance Method Details

#after_commit(&block) ⇒ Object



40
41
42
# File 'lib/sequent/test/event_handler_helpers.rb', line 40

def after_commit(&block)
  @after_commit_blocks << block
end

#transactionalObject



35
36
37
38
# File 'lib/sequent/test/event_handler_helpers.rb', line 35

def transactional
  yield
  @after_commit_blocks.each(&:call)
end