module Cucumber::Tcl

Constants

ActivateSteps

Public Class Methods

install(cucumber_config) click to toggle source
# File lib/cucumber/tcl.rb, line 15
def self.install(cucumber_config)
  # Unless configured off, we should start up a new
  # framework for each scenario, which results
  # in a new TCL interpreter.  This can be used
  # to check that there is no data leakage between
  # scenarios when testing poorly understood code
  share_framework = (ENV['SHARE_FRAMEWORK'] == '1')

  if !share_framework
      create_step_definitions = lambda {
        StepDefinitions.new(Framework.new(cucumber_config))
      }
  else
      framework = Framework.new(cucumber_config)
      create_step_definitions = lambda {
        StepDefinitions.new(framework)
      }
  end
  cucumber_config.filters << ActivateSteps.new(create_step_definitions)
end