Module: AppMap::Cucumber

Defined in:
lib/appmap/cucumber.rb

Defined Under Namespace

Classes: Provider4, ProviderBefore4, ProviderStruct, ScenarioAttributes

Constant Summary collapse

APPMAP_OUTPUT_DIR =
'tmp/appmap/cucumber'

Class Method Summary collapse

Class Method Details

.enabled?Boolean

Returns:

  • (Boolean)


56
57
58
# File 'lib/appmap/cucumber.rb', line 56

def enabled?
  ENV['APPMAP'] == 'true'
end

.initObject



43
44
45
46
47
# File 'lib/appmap/cucumber.rb', line 43

def init
  warn 'Configuring AppMap recorder for Cucumber'

  FileUtils.mkdir_p APPMAP_OUTPUT_DIR
end

.runObject



60
61
62
# File 'lib/appmap/cucumber.rb', line 60

def run
  init
end

.write_scenario(scenario, appmap) ⇒ Object



49
50
51
52
53
54
# File 'lib/appmap/cucumber.rb', line 49

def write_scenario(scenario, appmap)
  appmap['metadata'] = (scenario, appmap['metadata'])
  scenario_filename = AppMap::Util.scenario_filename(appmap['metadata']['name'])

  File.write(File.join(APPMAP_OUTPUT_DIR, scenario_filename), JSON.generate(appmap))
end