rspectacular 0.36.0 → 0.37.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbca676ebd5bdf10dd56f4b3ef7d422fb9313ca8
|
4
|
+
data.tar.gz: 8baa6609ef0702eb293321f951ba0555b1aed3f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 325f12d1dbc0121d2067b07a650643c7b416d4ea0fd13b0cdaf13a21de79d9a0607c54d59f99897ca6abdf15fff397f33ee659cd988b1063f2437a487121c8f1
|
7
|
+
data.tar.gz: 59565e5e618aba521b6fa035aca3234dca67e34a360f348d94221212e0c9b336c809b664ca20687502e2a82ca47732b75803d88d88ae9c3f83c70b75dedb0284
|
@@ -0,0 +1,37 @@
|
|
1
|
+
module Rspectacular
|
2
|
+
module VcrMatchers
|
3
|
+
class UriWithoutTrailingId
|
4
|
+
attr_accessor :trailing_id_matcher
|
5
|
+
|
6
|
+
def initialize(trailing_id_matcher)
|
7
|
+
self.trailing_id_matcher = trailing_id_matcher
|
8
|
+
end
|
9
|
+
|
10
|
+
def call(request, vcr_cassette_request)
|
11
|
+
request_uri = request.uri
|
12
|
+
vcr_cassette_request_uri = vcr_cassette_request.uri
|
13
|
+
|
14
|
+
if request_uri.match(trailing_id_matcher)
|
15
|
+
request_uri_without_id = request_uri.sub trailing_id_matcher, ''
|
16
|
+
vcr_cassette_request_uri_without_id = vcr_cassette_request_uri.sub trailing_id_matcher, ''
|
17
|
+
|
18
|
+
request_uri.match(trailing_id_matcher) &&
|
19
|
+
vcr_cassette_request_uri.match(trailing_id_matcher) &&
|
20
|
+
request_uri_without_id == vcr_cassette_request_uri_without_id
|
21
|
+
else
|
22
|
+
request_uri == vcr_cassette_request_uri
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
VCR.configure do |config|
|
30
|
+
config.register_request_matcher :uri_without_trailing_guid do |request, vcr_cassette_request|
|
31
|
+
Rspectacular::VcrMatchers::UriWithoutTrailingId.new(%r(/[a-f0-9]{32}/?\z)).call(request, vcr_cassette_request)
|
32
|
+
end
|
33
|
+
|
34
|
+
config.register_request_matcher :uri_without_trailing_id do |request, vcr_cassette_request|
|
35
|
+
Rspectacular::VcrMatchers::UriWithoutTrailingId.new(%r(/\d+/?\z)).call(request, vcr_cassette_request)
|
36
|
+
end
|
37
|
+
end
|
data/lib/rspectacular/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspectacular
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.37.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- jfelchner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-05-
|
11
|
+
date: 2014-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -111,6 +111,7 @@ files:
|
|
111
111
|
- lib/rspectacular/support/rails.rb
|
112
112
|
- lib/rspectacular/support/random.rb
|
113
113
|
- lib/rspectacular/support/selenium.rb
|
114
|
+
- lib/rspectacular/vcr_matchers/uri_without_trailing_id.rb
|
114
115
|
- lib/rspectacular/version.rb
|
115
116
|
- spec/spec_helper.rb
|
116
117
|
homepage: https://github.com/jfelchner/rspectacular
|