diff --git a/.gitignore b/.gitignore index c4210055..1de8b1c5 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,11 @@ features/LICENSE.md features/Upgrade.md features/CONTRIBUTING.md +## PROJECT::TOOLS + .rvmrc .yardoc doc + +## PROJECT::EDITORS +.idea/ \ No newline at end of file diff --git a/features/test_frameworks/cucumber.feature b/features/test_frameworks/cucumber.feature index ed6899d6..b83ca574 100644 --- a/features/test_frameworks/cucumber.feature +++ b/features/test_frameworks/cucumber.feature @@ -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" diff --git a/lib/vcr/test_frameworks/cucumber.rb b/lib/vcr/test_frameworks/cucumber.rb index ffcb7f2c..c9ec5800 100644 --- a/lib/vcr/test_frameworks/cucumber.rb +++ b/lib/vcr/test_frameworks/cucumber.rb @@ -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@/, '')}" diff --git a/spec/vcr/test_frameworks/cucumber_spec.rb b/spec/vcr/test_frameworks/cucumber_spec.rb index b7c798a2..990fa08c 100644 --- a/spec/vcr/test_frameworks/cucumber_spec.rb +++ b/spec/vcr/test_frameworks/cucumber_spec.rb @@ -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)