Class: VCR::CucumberTags::ScenarioNameBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/vcr/test_frameworks/cucumber.rb

Overview

Constructs a cassette name from a Cucumber 2 scenario outline

Instance Method Summary collapse

Constructor Details

#initialize(test_case) ⇒ ScenarioNameBuilder

Returns a new instance of ScenarioNameBuilder.



85
86
87
88
# File 'lib/vcr/test_frameworks/cucumber.rb', line 85

def initialize(test_case)
  @parts = []
  test_case.describe_source_to self
end

Instance Method Details

#cassette_nameObject



90
91
92
# File 'lib/vcr/test_frameworks/cucumber.rb', line 90

def cassette_name
  @parts.join("/")
end

#examples_table_row(row) ⇒ Object



103
104
105
106
# File 'lib/vcr/test_frameworks/cucumber.rb', line 103

def examples_table_row(row)
  @parts.unshift "| %s |" % row.values.join(" | ")
  self
end

#feature(feature) ⇒ Object Also known as: scenario_outline



94
95
96
97
# File 'lib/vcr/test_frameworks/cucumber.rb', line 94

def feature(feature)
  @parts.unshift feature.name
  self
end

#scenarioObject Also known as: examples_table



100
# File 'lib/vcr/test_frameworks/cucumber.rb', line 100

def scenario(*) self end