Skip to content

Commit 2aaf0b2

Browse files
committed
Fix rspec metadata integration.
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.
1 parent c021234 commit 2aaf0b2

File tree

4 files changed

+49
-16
lines changed

4 files changed

+49
-16
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## Unreleased changes
2+
[Full Changelog](http://github.com/vcr/vcr/compare/v2.9.1...master)
3+
4+
Bug Fixes:
5+
6+
* Fix RSpec metadata integration once more -- we changed it a bit more
7+
in response to user feedback. (Myron Marston)
8+
19
## 2.9.1 (May 23, 2014)
210
[Full Changelog](http://github.com/vcr/vcr/compare/v2.9.0...v2.9.1)
311

Gemfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ gem 'rake', '>= 0.9.2'
2626
gem 'cucumber', '>= 1.1.4'
2727
gem 'aruba', '>= 0.5'
2828

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

3133
gem 'fakeweb', '>= 1.3.0'
3234
gem 'webmock', '>= 1.14'

Gemfile.lock

Lines changed: 32 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,31 @@
1+
GIT
2+
remote: git://github.com/rspec/rspec-core.git
3+
revision: 5dad09158a9e5d94830dffcacc19f34e3bbc574f
4+
specs:
5+
rspec-core (3.0.0.rc1)
6+
rspec-support (= 3.0.0.rc1)
7+
8+
GIT
9+
remote: git://github.com/rspec/rspec-expectations.git
10+
revision: 1dce0c78b1a19f0d328d9574d7b3e4201e269b3f
11+
specs:
12+
rspec-expectations (3.0.0.rc1)
13+
diff-lcs (>= 1.2.0, < 2.0)
14+
rspec-support (= 3.0.0.rc1)
15+
16+
GIT
17+
remote: git://github.com/rspec/rspec-mocks.git
18+
revision: 6176d177121cdb4b83a31fac3b647ff89148a9b5
19+
specs:
20+
rspec-mocks (3.0.0.rc1)
21+
rspec-support (= 3.0.0.rc1)
22+
23+
GIT
24+
remote: git://github.com/rspec/rspec-support.git
25+
revision: b5f29f2f03ee57f3bbcca092e09fe5a7199b3580
26+
specs:
27+
rspec-support (3.0.0.rc1)
28+
129
PATH
230
remote: .
331
specs:
@@ -85,18 +113,6 @@ GEM
85113
rest-client (>= 1.6.1)
86114
rest-client (1.6.7)
87115
mime-types (>= 1.16)
88-
rspec (3.0.0.rc1)
89-
rspec-core (= 3.0.0.rc1)
90-
rspec-expectations (= 3.0.0.rc1)
91-
rspec-mocks (= 3.0.0.rc1)
92-
rspec-core (3.0.0.rc1)
93-
rspec-support (= 3.0.0.rc1)
94-
rspec-expectations (3.0.0.rc1)
95-
diff-lcs (>= 1.2.0, < 2.0)
96-
rspec-support (= 3.0.0.rc1)
97-
rspec-mocks (3.0.0.rc1)
98-
rspec-support (= 3.0.0.rc1)
99-
rspec-support (3.0.0.rc1)
100116
ruby-debug (0.10.4)
101117
columnize (>= 0.1)
102118
ruby-debug-base (~> 0.10.4.0)
@@ -147,7 +163,10 @@ DEPENDENCIES
147163
redcarpet (~> 1.17.2)
148164
redis (>= 2.2.2)
149165
relish (~> 0.6)
150-
rspec (>= 3.0.0.rc1)
166+
rspec-core!
167+
rspec-expectations!
168+
rspec-mocks!
169+
rspec-support!
151170
ruby-debug
152171
simplecov (>= 0.5.3)
153172
sinatra (>= 1.3.2)

lib/vcr/test_frameworks/rspec.rb

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,13 @@ def configure!
99
::RSpec.configure do |config|
1010
vcr_cassette_name_for = lambda do |metadata|
1111
description = metadata[:description]
12-
example_group = metadata[:parent_example_group] || metadata[:example_group]
12+
example_group = if metadata.key?(:example_group)
13+
metadata[:example_group]
14+
else
15+
metadata[:parent_example_group]
16+
end
1317

14-
if example_group && example_group.any?
18+
if example_group
1519
[vcr_cassette_name_for[example_group], description].join('/')
1620
else
1721
description

0 commit comments

Comments
 (0)