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.



74
75
76
77
# File 'lib/vcr/test_frameworks/cucumber.rb', line 74

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

Instance Method Details

#cassette_nameObject



79
80
81
# File 'lib/vcr/test_frameworks/cucumber.rb', line 79

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

#examples_table_row(row) ⇒ Object



92
93
94
95
# File 'lib/vcr/test_frameworks/cucumber.rb', line 92

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

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



83
84
85
86
# File 'lib/vcr/test_frameworks/cucumber.rb', line 83

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

#scenarioObject Also known as: examples_table



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

def scenario(*) self end