Skip to content

Commit

Permalink
Merge pull request #203 from pascalvanhecke/feature/scenario_name_in_…
Browse files Browse the repository at this point in the history
…case_of_multiline_scenario_description

Feature/scenario name in case of multiline scenario description
  • Loading branch information
myronmarston committed Oct 30, 2012
2 parents 85fbe14 + 978f932 commit 7d59ed7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .gitignore
Expand Up @@ -36,6 +36,11 @@ features/LICENSE.md
features/Upgrade.md
features/CONTRIBUTING.md

## PROJECT::TOOLS

.rvmrc
.yardoc
doc

## PROJECT::EDITORS
.idea/
6 changes: 6 additions & 0 deletions features/test_frameworks/cucumber.feature
Expand Up @@ -92,6 +92,12 @@ Feature: Usage with Cucumber
@vcr
Scenario: tagged scenario
Note: Like the feature pre-amble, Cucumber treats the scenario pre-amble
as part of the scenario name. When using the :use_scenario_name option,
VCR will only use the first line of the feature name as the directory
for the cassette.
When a request is made to "http://localhost:7777/localhost_request_1"
Then the response should be "Hello localhost_request_1"
Expand Down
2 changes: 1 addition & 1 deletion lib/vcr/test_frameworks/cucumber.rb
Expand Up @@ -43,7 +43,7 @@ def tags(*tag_names)
feature = scenario.respond_to?(:scenario_outline) ? scenario.scenario_outline.feature : scenario.feature
name = feature.name.split("\n").first
name << "/#{scenario.scenario_outline.name}" if scenario.respond_to?(:scenario_outline)
name << "/#{scenario.name}"
name << "/#{scenario.name.split("\n").first}"
name
else
"cucumber_tags/#{tag_name.gsub(/\A@/, '')}"
Expand Down
2 changes: 1 addition & 1 deletion spec/vcr/test_frameworks/cucumber_spec.rb
Expand Up @@ -9,7 +9,7 @@ def scenario(name)
stub(:name => name, :feature => stub(:name => "My feature name\nThe preamble text is not included"))
end

let(:current_scenario) { scenario "My scenario name" }
let(:current_scenario) { scenario "My scenario name\nThe preamble text is not included" }

# define our own Before/After so we can test this in isolation from cucumber's implementation.
def Before(tag, &block)
Expand Down

0 comments on commit 7d59ed7

Please sign in to comment.