-
Notifications
You must be signed in to change notification settings - Fork 16
/
spec_test.rb
52 lines (45 loc) · 1.31 KB
/
spec_test.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
require "helper"
MinitestVcr::Spec.configure!
describe MinitestVcr::Spec do
describe 'a describe with metadata', :vcr do
describe 'with a nested example group' do
before do
conn = Faraday.new
@response = conn.get 'http://example.com'
end
it 'uses a cassette for any examples' do
(VCR.current_cassette.name.split('/')).must_equal([
'MinitestVcr::Spec',
'a describe with metadata',
'with a nested example group',
'uses a cassette for any examples'
])
end
end
end
describe 'an it with metadata' do
describe 'with a nested example group' do
before do
conn = Faraday.new
@response = conn.get 'http://example.com'
end
it 'uses a cassette for any examples', :vcr do
(VCR.current_cassette.name.split('/')).must_equal([
'MinitestVcr::Spec',
'an it with metadata',
'with a nested example group',
'uses a cassette for any examples'
])
end
end
end
describe "#configure!", :vcr do
before do
::MiniTest::Spec.expects(:before).with(:each)
::MiniTest::Spec.expects(:after).with(:each)
end
it "should call before and after with proper args and block" do
MinitestVcr::Spec.configure!
end
end
end