site_prism.vcr 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +13 -5
- data/lib/site_prism_vcr/fixture.rb +4 -0
- data/lib/site_prism_vcr/fixtures/modifiers/path.rb +1 -1
- data/lib/site_prism_vcr/version.rb +1 -1
- data/spec/fixtures/custom/subpath/sansa_stark.yml +38 -0
- data/spec/support/shared/integration/home_path.rb +14 -0
- data/spec/unit/fixture_spec.rb +14 -0
- data/spec/unit/fixtures/modifiers/path_spec.rb +2 -2
- metadata +15 -13
checksums.yaml
CHANGED
@@ -1,7 +1,15 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
NjBjNmM0Nzk1NjIxZmU2NGQ4OGQ0M2U3MDkwNDU3YWIxNDUxMjM5ZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
NGVkNTk1MDVlMTNlN2Y5ZTgwMTRjYWM4MzdjMDFlMjYzY2FkZTFlOA==
|
5
7
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
ZjQyYmM5Y2M5ZGM3ZTY1NWQyNDY3ZTEwYjQ4ODkzNDcwY2Y2Y2M0ODY5NjA1
|
10
|
+
ZGNjNGUyZGEzYTQyYjZhYTNiZjA4NmM3Yzc3OWZhZTYxNWY2NTdlYTZiZTdm
|
11
|
+
NzVlMGM4ZjJlNThjMWQwMzNhZWE0NDFjNTcxYzY3MjMwZjUwYmY=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
MGFiMGI5YTk0OGRjYWIyMDRlMGUyNDU3YTI0MmNhNjY2ZjkyYWMyNTFhODIw
|
14
|
+
ZGIyMDAzMDY2M2MxNGQwZTJjNDY2NjQ1YTE3ZDY2YjQxZDkwNzRlMDNiMjgz
|
15
|
+
ODY5MGIwM2QwOTRkZTdmYjg1YTVkYzE5ZDhmYjIxZDRhNzZiNWE=
|
@@ -0,0 +1,38 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: get
|
5
|
+
uri: http://127.0.0.1:<%= port %>/api/cat/max
|
6
|
+
body:
|
7
|
+
encoding: US-ASCII
|
8
|
+
string: ''
|
9
|
+
headers:
|
10
|
+
Accept-Encoding:
|
11
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
12
|
+
Accept:
|
13
|
+
- '*/*'
|
14
|
+
User-Agent:
|
15
|
+
- Ruby
|
16
|
+
response:
|
17
|
+
status:
|
18
|
+
code: 200
|
19
|
+
message: 'OK'
|
20
|
+
headers:
|
21
|
+
Content-Type:
|
22
|
+
- application/json;charset=utf-8
|
23
|
+
Content-Length:
|
24
|
+
- '43'
|
25
|
+
X-Content-Type-Options:
|
26
|
+
- nosniff
|
27
|
+
Server:
|
28
|
+
- WEBrick/1.3.1 (Ruby/2.0.0/2013-06-27)
|
29
|
+
Date:
|
30
|
+
- Mon, 13 Jan 2014 21:01:47 GMT
|
31
|
+
Connection:
|
32
|
+
- Keep-Alive
|
33
|
+
body:
|
34
|
+
encoding: UTF-8
|
35
|
+
string: '{"cat_owner":"Sansa Stark","cat_name":"Max"}'
|
36
|
+
http_version:
|
37
|
+
recorded_at: Mon, 13 Jan 2014 21:01:47 GMT
|
38
|
+
recorded_with: VCR 2.8.0
|
@@ -60,4 +60,18 @@ shared_examples 'when a home path is define' do
|
|
60
60
|
expect(cat_owner).to have_content('Arya Stark')
|
61
61
|
end
|
62
62
|
end
|
63
|
+
|
64
|
+
context 'when a home path is used to point to a cessette in a sub directory', mytest: true do
|
65
|
+
before do
|
66
|
+
actor_without_home_path.public_send(action_method) do
|
67
|
+
home_path 'custom'
|
68
|
+
|
69
|
+
path '~/', ['subpath/sansa_stark']
|
70
|
+
end
|
71
|
+
end
|
72
|
+
|
73
|
+
it 'applies a stored fixture in the sub directory of the home path' do
|
74
|
+
expect(cat_owner).to have_content('Sansa Stark')
|
75
|
+
end
|
76
|
+
end
|
63
77
|
end
|
data/spec/unit/fixture_spec.rb
CHANGED
@@ -40,6 +40,20 @@ describe SPV::Fixture do
|
|
40
40
|
end
|
41
41
|
end
|
42
42
|
|
43
|
+
describe '#prepend_path' do
|
44
|
+
context 'when a fixture name contains a subpath' do
|
45
|
+
subject { described_class.new('subpath/somename') }
|
46
|
+
|
47
|
+
it 'prepends a path to a current subpath' do
|
48
|
+
subject.prepend_path 'somepath'
|
49
|
+
|
50
|
+
|
51
|
+
expect(subject.path).to be_an_instance_of(Pathname)
|
52
|
+
expect(subject.path.to_path).to eq('somepath/subpath')
|
53
|
+
end
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
43
57
|
describe '#set_home_path' do
|
44
58
|
subject { described_class.new('~/fixture_name') }
|
45
59
|
|
@@ -10,7 +10,7 @@ describe SPV::Fixtures::Modifiers::Path do
|
|
10
10
|
|
11
11
|
context 'when the path does not end with slash symbol' do
|
12
12
|
it 'adds a given path to the fixture with additional slash symbol' do
|
13
|
-
expect(fixture).to receive(:
|
13
|
+
expect(fixture).to receive(:prepend_path).with(path + '/')
|
14
14
|
|
15
15
|
subject
|
16
16
|
end
|
@@ -20,7 +20,7 @@ describe SPV::Fixtures::Modifiers::Path do
|
|
20
20
|
let(:path) { 'some path/' }
|
21
21
|
|
22
22
|
it 'adds a given path to the fixture without additional slash symbol' do
|
23
|
-
expect(fixture).to receive(:
|
23
|
+
expect(fixture).to receive(:prepend_path).with(path)
|
24
24
|
|
25
25
|
subject
|
26
26
|
end
|
metadata
CHANGED
@@ -1,55 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: site_prism.vcr
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dmitriy Nesteryuk
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: site_prism
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '2.6'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - ~>
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '2.6'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: vcr
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.9.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.9.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: webmock
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - ! '>='
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '0'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - ! '>='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
55
|
description: This gem integrates VCR library into SitePrism
|
@@ -59,9 +59,9 @@ executables: []
|
|
59
59
|
extensions: []
|
60
60
|
extra_rdoc_files: []
|
61
61
|
files:
|
62
|
-
-
|
63
|
-
-
|
64
|
-
-
|
62
|
+
- .gitignore
|
63
|
+
- .rspec
|
64
|
+
- .travis.yml
|
65
65
|
- CHANGELOG.md
|
66
66
|
- Gemfile
|
67
67
|
- LICENSE.txt
|
@@ -96,6 +96,7 @@ files:
|
|
96
96
|
- spec/fixtures/custom/blank.yml
|
97
97
|
- spec/fixtures/custom/bran_stark.yml
|
98
98
|
- spec/fixtures/custom/daenerys_targaryen.yml
|
99
|
+
- spec/fixtures/custom/subpath/sansa_stark.yml
|
99
100
|
- spec/fixtures/jon_snow.yml
|
100
101
|
- spec/fixtures/ned_stark.yml
|
101
102
|
- spec/fixtures/robb_stark.yml
|
@@ -150,12 +151,12 @@ require_paths:
|
|
150
151
|
- lib
|
151
152
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
153
|
requirements:
|
153
|
-
- -
|
154
|
+
- - ! '>='
|
154
155
|
- !ruby/object:Gem::Version
|
155
156
|
version: '0'
|
156
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
157
158
|
requirements:
|
158
|
-
- -
|
159
|
+
- - ! '>='
|
159
160
|
- !ruby/object:Gem::Version
|
160
161
|
version: '0'
|
161
162
|
requirements: []
|
@@ -173,6 +174,7 @@ test_files:
|
|
173
174
|
- spec/fixtures/custom/blank.yml
|
174
175
|
- spec/fixtures/custom/bran_stark.yml
|
175
176
|
- spec/fixtures/custom/daenerys_targaryen.yml
|
177
|
+
- spec/fixtures/custom/subpath/sansa_stark.yml
|
176
178
|
- spec/fixtures/jon_snow.yml
|
177
179
|
- spec/fixtures/ned_stark.yml
|
178
180
|
- spec/fixtures/robb_stark.yml
|