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.



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

def initialize
  @after_commit_blocks = []
end

Instance Method Details

#after_commit(&block) ⇒ Object



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

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

#transactionalObject



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

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