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)


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

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

.initObject



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

def init
  warn 'Configuring AppMap recorder for Cucumber'

  FileUtils.mkdir_p APPMAP_OUTPUT_DIR
end

.runObject



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

def run
  init
end

.write_scenario(scenario, appmap) ⇒ Object



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

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

  AppMap::Util.write_appmap(File.join(APPMAP_OUTPUT_DIR, scenario_filename), JSON.generate(appmap))
end