Skip to content

Commit

Permalink
Fix rspec metadata integration.
Browse files Browse the repository at this point in the history
vcr#414 updated to RSpec 3.0.0.rc1 but based on the feedback we got
from that (rspec/rspec-core#1552),
we changed the metadata a bit more
(rspec/rspec-core#1557), which broke
things here.
  • Loading branch information
myronmarston committed May 28, 2014
1 parent c021234 commit 2aaf0b2
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 16 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## Unreleased changes
[Full Changelog](http://github.com/vcr/vcr/compare/v2.9.1...master)

Bug Fixes:

* Fix RSpec metadata integration once more -- we changed it a bit more
in response to user feedback. (Myron Marston)

## 2.9.1 (May 23, 2014)
[Full Changelog](http://github.com/vcr/vcr/compare/v2.9.0...v2.9.1)

Expand Down
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ gem 'rake', '>= 0.9.2'
gem 'cucumber', '>= 1.1.4'
gem 'aruba', '>= 0.5'

gem 'rspec', '>= 3.0.0.rc1'
%w[ core mocks expectations support ].each do |name|
gem "rspec-#{name}", :github => "rspec/rspec-#{name}"
end

gem 'fakeweb', '>= 1.3.0'
gem 'webmock', '>= 1.14'
Expand Down
45 changes: 32 additions & 13 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,31 @@
GIT
remote: git://github.com/rspec/rspec-core.git
revision: 5dad09158a9e5d94830dffcacc19f34e3bbc574f
specs:
rspec-core (3.0.0.rc1)
rspec-support (= 3.0.0.rc1)

GIT
remote: git://github.com/rspec/rspec-expectations.git
revision: 1dce0c78b1a19f0d328d9574d7b3e4201e269b3f
specs:
rspec-expectations (3.0.0.rc1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.0.0.rc1)

GIT
remote: git://github.com/rspec/rspec-mocks.git
revision: 6176d177121cdb4b83a31fac3b647ff89148a9b5
specs:
rspec-mocks (3.0.0.rc1)
rspec-support (= 3.0.0.rc1)

GIT
remote: git://github.com/rspec/rspec-support.git
revision: b5f29f2f03ee57f3bbcca092e09fe5a7199b3580
specs:
rspec-support (3.0.0.rc1)

PATH
remote: .
specs:
Expand Down Expand Up @@ -85,18 +113,6 @@ GEM
rest-client (>= 1.6.1)
rest-client (1.6.7)
mime-types (>= 1.16)
rspec (3.0.0.rc1)
rspec-core (= 3.0.0.rc1)
rspec-expectations (= 3.0.0.rc1)
rspec-mocks (= 3.0.0.rc1)
rspec-core (3.0.0.rc1)
rspec-support (= 3.0.0.rc1)
rspec-expectations (3.0.0.rc1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (= 3.0.0.rc1)
rspec-mocks (3.0.0.rc1)
rspec-support (= 3.0.0.rc1)
rspec-support (3.0.0.rc1)
ruby-debug (0.10.4)
columnize (>= 0.1)
ruby-debug-base (~> 0.10.4.0)
Expand Down Expand Up @@ -147,7 +163,10 @@ DEPENDENCIES
redcarpet (~> 1.17.2)
redis (>= 2.2.2)
relish (~> 0.6)
rspec (>= 3.0.0.rc1)
rspec-core!
rspec-expectations!
rspec-mocks!
rspec-support!
ruby-debug
simplecov (>= 0.5.3)
sinatra (>= 1.3.2)
Expand Down
8 changes: 6 additions & 2 deletions lib/vcr/test_frameworks/rspec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,13 @@ def configure!
::RSpec.configure do |config|
vcr_cassette_name_for = lambda do |metadata|
description = metadata[:description]
example_group = metadata[:parent_example_group] || metadata[:example_group]
example_group = if metadata.key?(:example_group)
metadata[:example_group]
else
metadata[:parent_example_group]
end

if example_group && example_group.any?
if example_group
[vcr_cassette_name_for[example_group], description].join('/')
else
description
Expand Down

0 comments on commit 2aaf0b2

Please sign in to comment.