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

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

Instance Method Summary collapse

Constructor Details

#initializeFakeTransactionProvider

Returns a new instance of FakeTransactionProvider.



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

def initialize
  @after_commit_blocks = []
end

Instance Method Details

#after_commit(&block) ⇒ Object



44
45
46
# File 'lib/sequent/test/workflow_helpers.rb', line 44

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

#transactionalObject



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

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