parliament-utils 0.2.1 → 0.2.2
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 +4 -4
- data/lib/parliament/utils/test_helpers/vcr_helper.rb +11 -5
- data/lib/parliament/utils/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3a20daf87301bc5afe1af8c05732339621bc2c45
|
|
4
|
+
data.tar.gz: 7206dd59685b4c34724a90efbfe263b118178e08
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2137ac13c8f4ceab2bcbbb4bfe4ee381608b1812f79c433404620c5854d7860a0d36ffbdc9c30cba5ff92de3046c72fcd7507e71c72014dbf6dbe68ce794c8fd
|
|
7
|
+
data.tar.gz: 165cc4e2883e682812c7d5be7bdc5017e9730052cab8e271fa22bb71e951e46edcd87de33051896b251017b8eceda4a8f73d31d69b633447e2f5f10dfd92b4b1
|
|
@@ -5,6 +5,10 @@ module Parliament
|
|
|
5
5
|
require 'vcr'
|
|
6
6
|
|
|
7
7
|
def self.load_rspec_config(config)
|
|
8
|
+
# URIs that appear frequently
|
|
9
|
+
parliament_uri = 'http://localhost:3030'
|
|
10
|
+
bandiera_uri = 'http://localhost:5000'
|
|
11
|
+
opensearch_uri = 'https://apidataparliament.azure-api.net/search/description'
|
|
8
12
|
|
|
9
13
|
VCR.configure do |config|
|
|
10
14
|
config.cassette_library_dir = 'spec/fixtures/vcr_cassettes'
|
|
@@ -18,18 +22,20 @@ module Parliament
|
|
|
18
22
|
|
|
19
23
|
# Create a simple matcher which will 'filter' any request URIs on the fly
|
|
20
24
|
config.register_request_matcher :filtered_uri do |request_1, request_2|
|
|
21
|
-
parliament_match = request_1.uri.sub(ENV['PARLIAMENT_BASE_URL'],
|
|
22
|
-
bandiera_match
|
|
25
|
+
parliament_match = request_1.uri.sub(ENV['PARLIAMENT_BASE_URL'], parliament_uri) == request_2.uri.sub(ENV['PARLIAMENT_BASE_URL'], parliament_uri)
|
|
26
|
+
bandiera_match = request_1.uri.sub(ENV['BANDIERA_URL'], bandiera_uri) == request_2.uri.sub(ENV['BANDIERA_URL'], bandiera_uri)
|
|
27
|
+
opensearch_match = request_1.uri.sub(ENV['OPENSEARCH_DESCRIPTION_URL'], opensearch_uri) == request_2.uri.sub(ENV['OPENSEARCH_DESCRIPTION_URL'], opensearch_uri)
|
|
23
28
|
|
|
24
|
-
parliament_match || bandiera_match
|
|
29
|
+
parliament_match || bandiera_match || opensearch_match
|
|
25
30
|
end
|
|
26
31
|
|
|
27
32
|
config.default_cassette_options = { match_requests_on: [:method, :filtered_uri] }
|
|
28
33
|
|
|
29
34
|
# Dynamically filter our sensitive information
|
|
30
35
|
config.filter_sensitive_data('<AUTH_TOKEN>') { ENV['PARLIAMENT_AUTH_TOKEN'] }
|
|
31
|
-
config.filter_sensitive_data(
|
|
32
|
-
config.filter_sensitive_data(
|
|
36
|
+
config.filter_sensitive_data(parliament_uri) { ENV['PARLIAMENT_BASE_URL'] }
|
|
37
|
+
config.filter_sensitive_data(bandiera_uri) { ENV['BANDIERA_URL'] }
|
|
38
|
+
config.filter_sensitive_data(opensearch_uri) { ENV['OPENSEARCH_DESCRIPTION_URL'] }
|
|
33
39
|
|
|
34
40
|
# Dynamically filter n-triple data
|
|
35
41
|
config.before_record do |interaction|
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: parliament-utils
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Rebecca Appleyard
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2017-08-
|
|
11
|
+
date: 2017-08-24 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: parliament-ruby
|