parliament-utils 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6181b19123e8c926e216c7c38712043242e829af
4
- data.tar.gz: 0e0089c083752bb47e7a23fe819492e1522908a3
3
+ metadata.gz: 3a20daf87301bc5afe1af8c05732339621bc2c45
4
+ data.tar.gz: 7206dd59685b4c34724a90efbfe263b118178e08
5
5
  SHA512:
6
- metadata.gz: 736ffc1bd11ad2e49db8bc20e07849e5b7dd922490b24dd0a87f53fc48f6d9c238960265e8ec79675e3674d3856c594c2c371d71f78eb263f024b4e54a19e7ba
7
- data.tar.gz: 1c3bb9dc1999fedefb3662621aa4c145d077e149e75cbcb3ec7340cfa060155ba56909eee7e28e6089b19a4f9452d464fa8315192280e3e0168b64d0ce590479
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'], 'http://localhost:3030') == request_2.uri.sub(ENV['PARLIAMENT_BASE_URL'], 'http://localhost:3030')
22
- bandiera_match = request_1.uri.sub(ENV['BANDIERA_URL'], 'http://localhost:5000') == request_2.uri.sub(ENV['BANDIERA_URL'], 'http://localhost:5000')
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('http://localhost:3030') { ENV['PARLIAMENT_BASE_URL'] }
32
- config.filter_sensitive_data('http://localhost:5000') { ENV['BANDIERA_URL'] }
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|
@@ -1,5 +1,5 @@
1
1
  module Parliament
2
2
  module Utils
3
- VERSION = '0.2.1'.freeze
3
+ VERSION = '0.2.2'.freeze
4
4
  end
5
5
  end
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.1
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-07 00:00:00.000000000 Z
11
+ date: 2017-08-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: parliament-ruby