webvalve 0.9.9 → 0.9.10

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
- SHA1:
3
- metadata.gz: ee21f56868562d76912798f434460bb7373336b5
4
- data.tar.gz: 1a272c0725e2dd5797d233f76f687262fe51cf9a
2
+ SHA256:
3
+ metadata.gz: e78700063483cd49d8ee34f059f807c6640a002e3380f8f255a742ae01aef042
4
+ data.tar.gz: f7d1b324e129d5fbe368ef22bd98ddddf83ddf8a9252f8ed539142b3688ab6a9
5
5
  SHA512:
6
- metadata.gz: a2e6a9654e68364a26ddee0ff97da75b3d720d39af191842ef8507fc210490e2816ee2ffb650a7bf840c48b58523bf0d34c3a7f747cebd408dfd2bd0415540ac
7
- data.tar.gz: aafb419aac580481b09d740da59f689b563b5554042f795104e46b0ddd62e84477cd8d3059f6a826be994bbee56bffa6ca0fb5926494e60f9ef4eba36c7ff379
6
+ metadata.gz: f1781dd8a0d8d64fe570164febfb328f60e3dabf757931fecf16c326bae36a87dd6d1b52dab62bfb588b5e07bb0f0795c61f92b395c5d2e9ea82b16266fd2f49
7
+ data.tar.gz: 43a431a534c6dd790b05fd7767125b22359fa2d17e2d3fd87a1119bc9f242457ac4e355a069cdb172f5ba61cbe9e2e9225a6cf8072ee7e2c6b328f9d7e2a230c
@@ -9,6 +9,10 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
9
9
  ### Added
10
10
  ### Removed
11
11
 
12
+ ## [0.9.10] - 2019-09-09
13
+ ### Changed
14
+ - rename `whitelist_url` to `allow_url` (https://github.com/Betterment/retail/pull/4424)
15
+
12
16
  ## [0.9.9] - 2019-05-24
13
17
  ### Changed
14
18
  - fix integration with `webdrivers` gem so Rails 6 should work out of the box (https://github.com/Betterment/webvalve/pull/32)
@@ -31,6 +35,7 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
31
35
  - WebMock 3+ support from @messanjah (https://github.com/Betterment/webvalve/pull/22)
32
36
 
33
37
  [Unreleased]: https://github.com/Betterment/webvalve/compare/v0.9.9...HEAD
38
+ [0.9.10]: https://github.com/Betterment/webvalve/compare/v0.9.9...v0.9.10
34
39
  [0.9.9]: https://github.com/Betterment/webvalve/compare/v0.9.8...v0.9.9
35
40
  [0.9.8]: https://github.com/Betterment/webvalve/compare/v0.9.7...v0.9.8
36
41
  [0.9.7]: https://github.com/Betterment/webvalve/compare/v0.9.6...v0.9.7
data/README.md CHANGED
@@ -71,9 +71,9 @@ This will drop a new file in your config directory.
71
71
  # WebValve.register FakeBank
72
72
  # WebValve.register FakeExample, url: 'https://api.example.org'
73
73
  #
74
- # # whitelist urls
74
+ # # add urls to allowlist
75
75
  #
76
- # WebValve.whitelist_url 'https://example.com'
76
+ # WebValve.allow_url 'https://example.com'
77
77
  ```
78
78
 
79
79
  If you're not using Rails, you can create this file for yourself.
@@ -19,9 +19,9 @@ module Webvalve
19
19
  # WebValve.register FakeThing
20
20
  # WebValve.register FakeExample, url: 'https://api.example.org'
21
21
  #
22
- # # whitelist urls
22
+ # # add urls to the allowlist
23
23
  #
24
- # WebValve.whitelist_url 'https://example.com'
24
+ # WebValve.allow_url 'https://example.com'
25
25
  FILE
26
26
  end
27
27
 
@@ -11,11 +11,11 @@ module WebValve
11
11
  # @see WebValve::Manager#setup
12
12
  # @!method register
13
13
  # @see WebValve::Manager#register
14
- # @!method whitelist_url
15
- # @see WebValve::Manager#whitelist_url
14
+ # @!method allow_url
15
+ # @see WebValve::Manager#allow_url
16
16
  # @!method reset
17
17
  # @see WebValve::Manager#reset
18
- delegate :setup, :register, :whitelist_url, :reset, to: :manager
18
+ delegate :setup, :register, :allow_url, :reset, to: :manager
19
19
  attr_writer :logger
20
20
 
21
21
  def enabled?
@@ -12,9 +12,9 @@ module WebValve
12
12
  fake_service_configs << FakeServiceConfig.new(service: fake_service, **args)
13
13
  end
14
14
 
15
- def whitelist_url(url)
16
- raise "#{url} already registered" if whitelisted_urls.include?(url)
17
- whitelisted_urls << url
15
+ def allow_url(url)
16
+ raise "#{url} already registered" if allowlisted_urls.include?(url)
17
+ allowlisted_urls << url
18
18
  end
19
19
 
20
20
  def setup
@@ -22,7 +22,7 @@ module WebValve
22
22
  if config.should_intercept?
23
23
  webmock_service config
24
24
  else
25
- whitelist_service config
25
+ allowlist_service config
26
26
  end
27
27
  end
28
28
 
@@ -32,7 +32,7 @@ module WebValve
32
32
 
33
33
  # @api private
34
34
  def reset
35
- whitelisted_urls.clear
35
+ allowlisted_urls.clear
36
36
  fake_service_configs.clear
37
37
  end
38
38
 
@@ -42,20 +42,20 @@ module WebValve
42
42
  end
43
43
 
44
44
  # @api private
45
- def whitelisted_urls
46
- @whitelisted_urls ||= Set.new
45
+ def allowlisted_urls
46
+ @allowlisted_urls ||= Set.new
47
47
  end
48
48
 
49
49
  private
50
50
 
51
51
  def webmock_disable_options
52
52
  { allow_localhost: true }.tap do |opts|
53
- opts[:allow] = whitelisted_url_regexps unless WebValve.env.test?
53
+ opts[:allow] = allowlisted_url_regexps unless WebValve.env.test?
54
54
  end
55
55
  end
56
56
 
57
- def whitelisted_url_regexps
58
- whitelisted_urls.map { |url| url_to_regexp url }
57
+ def allowlisted_url_regexps
58
+ allowlisted_urls.map { |url| url_to_regexp url }
59
59
  end
60
60
 
61
61
  def webmock_service(config)
@@ -65,8 +65,8 @@ module WebValve
65
65
  ).to_rack(FakeServiceWrapper.new(config.service))
66
66
  end
67
67
 
68
- def whitelist_service(config)
69
- whitelisted_urls << config.service_url
68
+ def allowlist_service(config)
69
+ allowlisted_urls << config.service_url
70
70
  end
71
71
 
72
72
  def url_to_regexp(url)
@@ -1,3 +1,3 @@
1
1
  module WebValve
2
- VERSION = "0.9.9"
2
+ VERSION = "0.9.10"
3
3
  end
@@ -1,32 +1,32 @@
1
1
  example_id | status | run_time |
2
2
  ------------------------------------------------------ | ------ | --------------- |
3
- ./spec/webvalve/fake_service_config_spec.rb[1:1:1:1] | passed | 0.0003 seconds |
4
- ./spec/webvalve/fake_service_config_spec.rb[1:1:1:2] | passed | 0.00014 seconds |
5
- ./spec/webvalve/fake_service_config_spec.rb[1:1:2:1] | passed | 0.0002 seconds |
6
- ./spec/webvalve/fake_service_config_spec.rb[1:1:2:2] | passed | 0.00017 seconds |
7
- ./spec/webvalve/fake_service_config_spec.rb[1:1:2:3] | passed | 0.00019 seconds |
8
- ./spec/webvalve/fake_service_config_spec.rb[1:1:3:1] | passed | 0.00013 seconds |
3
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:1:1] | passed | 0.00013 seconds |
4
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:1:2] | passed | 0.00013 seconds |
5
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:2:1] | passed | 0.00013 seconds |
6
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:2:2] | passed | 0.00016 seconds |
7
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:2:3] | passed | 0.00017 seconds |
8
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:3:1] | passed | 0.00019 seconds |
9
9
  ./spec/webvalve/fake_service_config_spec.rb[1:1:3:2] | passed | 0.00014 seconds |
10
- ./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:1] | passed | 0.00015 seconds |
11
- ./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:2] | passed | 0.00039 seconds |
12
- ./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.00247 seconds |
13
- ./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.00161 seconds |
14
- ./spec/webvalve/fake_service_config_spec.rb[1:2:3] | passed | 0.0002 seconds |
15
- ./spec/webvalve/fake_service_spec.rb[1:1] | passed | 0.00354 seconds |
16
- ./spec/webvalve/fake_service_spec.rb[1:2:1] | passed | 0.02646 seconds |
17
- ./spec/webvalve/fake_service_spec.rb[1:2:2] | passed | 0.02043 seconds |
18
- ./spec/webvalve/manager_spec.rb[1:1] | passed | 0.00008 seconds |
19
- ./spec/webvalve/manager_spec.rb[1:2:1] | passed | 0.00228 seconds |
20
- ./spec/webvalve/manager_spec.rb[1:3:1] | passed | 0.00022 seconds |
21
- ./spec/webvalve/manager_spec.rb[1:4:1] | passed | 0.0001 seconds |
22
- ./spec/webvalve/manager_spec.rb[1:5:1] | passed | 0.00046 seconds |
23
- ./spec/webvalve/manager_spec.rb[1:5:2] | passed | 0.00065 seconds |
24
- ./spec/webvalve/manager_spec.rb[1:5:3] | passed | 0.01468 seconds |
25
- ./spec/webvalve/manager_spec.rb[1:5:4:1] | passed | 0.00055 seconds |
26
- ./spec/webvalve/manager_spec.rb[1:5:5:1] | passed | 0.00053 seconds |
27
- ./spec/webvalve/manager_spec.rb[1:5:5:2] | passed | 0.00093 seconds |
28
- ./spec/webvalve/manager_spec.rb[1:5:5:3] | passed | 0.00188 seconds |
29
- ./spec/webvalve_spec.rb[1:1] | passed | 0.00006 seconds |
30
- ./spec/webvalve_spec.rb[1:2] | passed | 0.00013 seconds |
31
- ./spec/webvalve_spec.rb[1:3] | passed | 0.00008 seconds |
32
- ./spec/webvalve_spec.rb[1:4] | passed | 0.00182 seconds |
10
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:1] | passed | 0.00016 seconds |
11
+ ./spec/webvalve/fake_service_config_spec.rb[1:1:3:3:2] | passed | 0.00016 seconds |
12
+ ./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.00015 seconds |
13
+ ./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.00013 seconds |
14
+ ./spec/webvalve/fake_service_config_spec.rb[1:2:3] | passed | 0.00013 seconds |
15
+ ./spec/webvalve/fake_service_spec.rb[1:1] | passed | 0.00273 seconds |
16
+ ./spec/webvalve/fake_service_spec.rb[1:2:1] | passed | 0.0183 seconds |
17
+ ./spec/webvalve/fake_service_spec.rb[1:2:2] | passed | 0.01809 seconds |
18
+ ./spec/webvalve/manager_spec.rb[1:1] | passed | 0.00069 seconds |
19
+ ./spec/webvalve/manager_spec.rb[1:2:1] | passed | 0.00233 seconds |
20
+ ./spec/webvalve/manager_spec.rb[1:3:1] | passed | 0.00182 seconds |
21
+ ./spec/webvalve/manager_spec.rb[1:4:1] | passed | 0.00134 seconds |
22
+ ./spec/webvalve/manager_spec.rb[1:5:1] | passed | 0.03628 seconds |
23
+ ./spec/webvalve/manager_spec.rb[1:5:2] | passed | 0.00118 seconds |
24
+ ./spec/webvalve/manager_spec.rb[1:5:3] | passed | 0.00128 seconds |
25
+ ./spec/webvalve/manager_spec.rb[1:5:4:1] | passed | 0.00141 seconds |
26
+ ./spec/webvalve/manager_spec.rb[1:5:5:1] | passed | 0.00147 seconds |
27
+ ./spec/webvalve/manager_spec.rb[1:5:5:2] | passed | 0.00148 seconds |
28
+ ./spec/webvalve/manager_spec.rb[1:5:5:3] | passed | 0.00347 seconds |
29
+ ./spec/webvalve_spec.rb[1:1] | passed | 0.00008 seconds |
30
+ ./spec/webvalve_spec.rb[1:2] | passed | 0.00011 seconds |
31
+ ./spec/webvalve_spec.rb[1:3] | passed | 0.00209 seconds |
32
+ ./spec/webvalve_spec.rb[1:4] | passed | 0.00009 seconds |
@@ -8,12 +8,12 @@ RSpec.describe WebValve::Manager do
8
8
  described_class.is_a? Singleton
9
9
  end
10
10
 
11
- describe '#whitelist_url' do
11
+ describe '#allow_url' do
12
12
  it 'raises on duplicates' do
13
- subject.whitelist_url "foo"
14
- expect { subject.whitelist_url "foo" }.to raise_error(/already registered/)
15
- expect(subject.whitelisted_urls.count).to eq 1
16
- expect(subject.whitelisted_urls).to contain_exactly(/foo/)
13
+ subject.allow_url "foo"
14
+ expect { subject.allow_url "foo" }.to raise_error(/already registered/)
15
+ expect(subject.allowlisted_urls.count).to eq 1
16
+ expect(subject.allowlisted_urls).to contain_exactly(/foo/)
17
17
  end
18
18
  end
19
19
 
@@ -69,12 +69,12 @@ RSpec.describe WebValve::Manager do
69
69
  end
70
70
  end
71
71
 
72
- it 'does not whitelist configured urls in webmock' do
72
+ it 'does not allowlist configured urls in webmock' do
73
73
  allow(WebMock).to receive(:disable_net_connect!)
74
74
  results = [%r{\Ahttp://foo\.dev}, %r{\Ahttp://bar\.dev}]
75
75
 
76
- subject.whitelist_url 'http://foo.dev'
77
- subject.whitelist_url 'http://bar.dev'
76
+ subject.allow_url 'http://foo.dev'
77
+ subject.allow_url 'http://bar.dev'
78
78
 
79
79
  subject.setup
80
80
 
@@ -90,12 +90,12 @@ RSpec.describe WebValve::Manager do
90
90
  end
91
91
  end
92
92
 
93
- it 'whitelists configured urls in webmock' do
93
+ it 'allowlists configured urls in webmock' do
94
94
  allow(WebMock).to receive(:disable_net_connect!)
95
95
  results = [%r{\Ahttp://foo\.dev}, %r{\Ahttp://bar\.dev}]
96
96
 
97
- subject.whitelist_url 'http://foo.dev'
98
- subject.whitelist_url 'http://bar.dev'
97
+ subject.allow_url 'http://foo.dev'
98
+ subject.allow_url 'http://bar.dev'
99
99
 
100
100
  subject.setup
101
101
 
@@ -117,7 +117,7 @@ RSpec.describe WebValve::Manager do
117
117
  expect(web_mock_stubble).to have_received(:to_rack)
118
118
  end
119
119
 
120
- it 'whitelists registered fakes that are enabled in ENV' do
120
+ it 'allowlists registered fakes that are enabled in ENV' do
121
121
  enabled_service = class_double(WebValve::FakeService, name: 'FakeSomething')
122
122
 
123
123
  with_env 'SOMETHING_ENABLED' => '1', 'SOMETHING_API_URL' => 'http://real.dev' do
@@ -125,7 +125,7 @@ RSpec.describe WebValve::Manager do
125
125
  subject.setup
126
126
  end
127
127
 
128
- expect(subject.whitelisted_urls).to include 'http://real.dev'
128
+ expect(subject.allowlisted_urls).to include 'http://real.dev'
129
129
  end
130
130
  end
131
131
  end
@@ -13,7 +13,7 @@ RSpec.describe WebValve do
13
13
  expect(described_class).to respond_to(:reset)
14
14
  end
15
15
 
16
- it 'delegates .whitelist_url to manager' do
17
- expect(described_class).to respond_to(:whitelist_url)
16
+ it 'delegates .allow_url to manager' do
17
+ expect(described_class).to respond_to(:allow_url)
18
18
  end
19
19
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webvalve
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.9
4
+ version: 0.9.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Moore
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-24 00:00:00.000000000 Z
11
+ date: 2019-09-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -220,8 +220,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
220
220
  - !ruby/object:Gem::Version
221
221
  version: '0'
222
222
  requirements: []
223
- rubyforge_project:
224
- rubygems_version: 2.5.1
223
+ rubygems_version: 3.0.6
225
224
  signing_key:
226
225
  specification_version: 4
227
226
  summary: A library for faking http service integrations in development and test