Module: Simple::Workflow::RSpecHelper

Defined in:
lib/simple/workflow/rspec_helper.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



2
3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/simple/workflow/rspec_helper.rb', line 2

def self.included(base)
  base.let(:current_context) { {} }

  base.around do |example|
    if (ctx = current_context)
      ::Simple::Workflow.with_context(ctx) do
        example.run
      end
    else
      example.run
    end
  end
end