From 126c5af63cf7274cc7074a30c11c3ab995811cc4 Mon Sep 17 00:00:00 2001 From: Pascal Van Hecke Date: Mon, 29 Oct 2012 12:19:07 +0100 Subject: [PATCH 1/2] Excluding Rubymine project config files from repo --- .gitignore | 5 +++++ 1 file changed, 5 insertions(+) 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 From 978f932a999b0e29b1d3c52f2d874d630699e298 Mon Sep 17 00:00:00 2001 From: Pascal Van Hecke Date: Mon, 29 Oct 2012 13:02:50 +0100 Subject: [PATCH 2/2] Only use the first line of the cuke scenario name in the cassette name. Just like features, scenarios can have multiline preambles. When using the :use_scenario_name option, VCR will only use the first line of the scenario name as the directory for the cassette. This change is modeled after commit 034bdaf6935cfc482b807171e0c677f3a967224b --- features/test_frameworks/cucumber.feature | 6 ++++++ lib/vcr/test_frameworks/cucumber.rb | 2 +- spec/vcr/test_frameworks/cucumber_spec.rb | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) 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)