webvalve 1.0.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +30 -1
- data/README.md +1 -1
- data/lib/webvalve/fake_service_config.rb +6 -3
- data/lib/webvalve/manager.rb +17 -3
- data/lib/webvalve/railtie.rb +0 -5
- data/lib/webvalve/rspec.rb +1 -1
- data/lib/webvalve/version.rb +1 -1
- data/lib/webvalve.rb +14 -3
- data/spec/dummy/config/application.rb +3 -23
- data/spec/examples.txt +66 -59
- data/spec/spec_helper.rb +3 -1
- data/spec/support/rails_root.rb +7 -0
- data/spec/webvalve/fake_service_spec.rb +1 -1
- data/spec/webvalve/manager_spec.rb +15 -0
- metadata +24 -77
- data/spec/dummy/README.rdoc +0 -28
- data/spec/dummy/Rakefile +0 -6
- data/spec/dummy/app/assets/config/manifest.js +0 -3
- data/spec/dummy/app/assets/javascripts/application.js +0 -13
- data/spec/dummy/app/assets/stylesheets/application.css +0 -15
- data/spec/dummy/app/controllers/application_controller.rb +0 -5
- data/spec/dummy/app/helpers/application_helper.rb +0 -2
- data/spec/dummy/app/views/layouts/application.html.erb +0 -13
- data/spec/dummy/bin/bundle +0 -3
- data/spec/dummy/bin/rails +0 -4
- data/spec/dummy/bin/rake +0 -4
- data/spec/dummy/bin/setup +0 -29
- data/spec/dummy/config/boot.rb +0 -5
- data/spec/dummy/config/database.yml +0 -25
- data/spec/dummy/config/environment.rb +0 -5
- data/spec/dummy/config/environments/development.rb +0 -41
- data/spec/dummy/config/environments/production.rb +0 -79
- data/spec/dummy/config/environments/test.rb +0 -42
- data/spec/dummy/config/initializers/assets.rb +0 -11
- data/spec/dummy/config/initializers/backtrace_silencers.rb +0 -7
- data/spec/dummy/config/initializers/cookies_serializer.rb +0 -3
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +0 -4
- data/spec/dummy/config/initializers/inflections.rb +0 -16
- data/spec/dummy/config/initializers/mime_types.rb +0 -4
- data/spec/dummy/config/initializers/session_store.rb +0 -3
- data/spec/dummy/config/initializers/wrap_parameters.rb +0 -14
- data/spec/dummy/config/locales/en.yml +0 -23
- data/spec/dummy/config/routes.rb +0 -2
- data/spec/dummy/config/secrets.yml +0 -22
- data/spec/dummy/config.ru +0 -4
- data/spec/dummy/log/test.log +0 -24
- data/spec/dummy/public/404.html +0 -67
- data/spec/dummy/public/422.html +0 -67
- data/spec/dummy/public/500.html +0 -66
- data/spec/dummy/public/favicon.ico +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e0bd9695d36fa852af70059c6b101a2452e20f01b4b8a53aa7c52583618f413
|
4
|
+
data.tar.gz: 0b75b4a0d19ab3459105fe9a433416faca1d2de18ed5c2758d8f841e156a8f60
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45c15aac6732c0da81fa91eeec6e9a1bfb8ad5d8aeeca07f567d05e9de03ec5765dbfd6053e22f7dc16f660e41d75a8052ea3f5dd548386b3d8d82fe27355bc7
|
7
|
+
data.tar.gz: 0e6a1709246c23e3ef4c482767275d78ed458333f344bcaf96132662a0b373b30eff174560b806de68b84b6cf04e1d83ba9facd102e0b7d0f0d7d98fc0083ad3
|
data/CHANGELOG.md
CHANGED
@@ -9,6 +9,31 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
9
9
|
### Added
|
10
10
|
### Removed
|
11
11
|
|
12
|
+
## [1.2.0] - 2021-12-16
|
13
|
+
### Added
|
14
|
+
- Official support for Ruby 2.7 and 3.0
|
15
|
+
- Official support for Rails 6.2 and 7.0
|
16
|
+
### Removed
|
17
|
+
- Drops support for Rails < 5.2
|
18
|
+
- Drops support for Ruby < 2.6
|
19
|
+
|
20
|
+
## [1.1.0] - 2020-04-27
|
21
|
+
### Changed
|
22
|
+
- Allow the same URL for services as long as basic auth is different
|
23
|
+
(https://github.com/Betterment/webvalve/pull/46)
|
24
|
+
- Introduce `reset!` and `clear!` to replace `reset`
|
25
|
+
https://github.com/Betterment/webvalve/pull/45)
|
26
|
+
|
27
|
+
## [1.0.2] - 2020-04-27
|
28
|
+
### Changed
|
29
|
+
- Fix an issue with setup / reset
|
30
|
+
(https://github.com/Betterment/webvalve/pull/44)
|
31
|
+
|
32
|
+
## [1.0.1] - 2020-04-24
|
33
|
+
### Changed
|
34
|
+
- Fix an issue in rspec setup / usage of `WebValve.reset`
|
35
|
+
(https://github.com/Betterment/webvalve/pull/43)
|
36
|
+
|
12
37
|
## [1.0.0] - 2020-04-22
|
13
38
|
### Changed
|
14
39
|
- Support API_URLs that include path
|
@@ -57,7 +82,11 @@ and this project aims to adhere to [Semantic Versioning](http://semver.org/spec/
|
|
57
82
|
### Changed
|
58
83
|
- WebMock 3+ support from @messanjah (https://github.com/Betterment/webvalve/pull/22)
|
59
84
|
|
60
|
-
[Unreleased]: https://github.com/Betterment/webvalve/compare/v1.
|
85
|
+
[Unreleased]: https://github.com/Betterment/webvalve/compare/v1.2.0...HEAD
|
86
|
+
[1.2.0]: https://github.com/Betterment/webvalve/compare/v1.1.0...v1.2.0
|
87
|
+
[1.1.0]: https://github.com/Betterment/webvalve/compare/v1.0.2...v1.1.0
|
88
|
+
[1.0.2]: https://github.com/Betterment/webvalve/compare/v1.0.1...v1.0.2
|
89
|
+
[1.0.1]: https://github.com/Betterment/webvalve/compare/v1.0.0...v1.0.1
|
61
90
|
[1.0.0]: https://github.com/Betterment/webvalve/compare/v0.12.0...v1.0.0
|
62
91
|
[0.12.0]: https://github.com/Betterment/webvalve/compare/v0.11.0...v0.12.0
|
63
92
|
[0.11.0]: https://github.com/Betterment/webvalve/compare/v0.10.0...v0.11.0
|
data/README.md
CHANGED
@@ -15,11 +15,14 @@ module WebValve
|
|
15
15
|
value_from_env.present? && WebValve::DISABLED_VALUES.include?(value_from_env.to_s)
|
16
16
|
end
|
17
17
|
|
18
|
+
def full_url
|
19
|
+
@full_url ||= custom_service_url || default_service_url
|
20
|
+
end
|
21
|
+
|
18
22
|
def service_url
|
19
23
|
@service_url ||= begin
|
20
|
-
|
21
|
-
|
22
|
-
strip_basic_auth url
|
24
|
+
raise missing_url_message if full_url.blank?
|
25
|
+
strip_basic_auth full_url
|
23
26
|
end
|
24
27
|
end
|
25
28
|
|
data/lib/webvalve/manager.rb
CHANGED
@@ -24,6 +24,7 @@ module WebValve
|
|
24
24
|
|
25
25
|
def setup
|
26
26
|
return unless enabled?
|
27
|
+
load_configs!
|
27
28
|
|
28
29
|
if intercepting?
|
29
30
|
fake_service_configs.each do |config|
|
@@ -66,7 +67,13 @@ module WebValve
|
|
66
67
|
end
|
67
68
|
|
68
69
|
# @api private
|
69
|
-
def reset
|
70
|
+
def reset!
|
71
|
+
clear!
|
72
|
+
setup
|
73
|
+
end
|
74
|
+
|
75
|
+
# @api private
|
76
|
+
def clear!
|
70
77
|
allowlisted_urls.clear
|
71
78
|
fake_service_configs.clear
|
72
79
|
stubbed_urls.clear
|
@@ -145,8 +152,15 @@ module WebValve
|
|
145
152
|
end
|
146
153
|
|
147
154
|
def ensure_non_duplicate_stub(config)
|
148
|
-
raise "Invalid config for #{config.service_class_name}. Already stubbed url #{config.
|
149
|
-
stubbed_urls << config.
|
155
|
+
raise "Invalid config for #{config.service_class_name}. Already stubbed url #{config.full_url}" if stubbed_urls.include?(config.full_url)
|
156
|
+
stubbed_urls << config.full_url
|
157
|
+
end
|
158
|
+
|
159
|
+
def load_configs!
|
160
|
+
WebValve.config_paths.each do |root|
|
161
|
+
path = root.join('config', 'webvalve.rb').to_s
|
162
|
+
load path if File.exist?(path)
|
163
|
+
end
|
150
164
|
end
|
151
165
|
|
152
166
|
def stubbed_urls
|
data/lib/webvalve/railtie.rb
CHANGED
@@ -12,11 +12,6 @@ module WebValve
|
|
12
12
|
|
13
13
|
initializer 'webvalve.setup', after: :load_config_initializers do
|
14
14
|
if WebValve.enabled?
|
15
|
-
WebValve.config_paths.each do |root|
|
16
|
-
path = root.join('config', 'webvalve.rb').to_s
|
17
|
-
load path if File.exist?(path)
|
18
|
-
end
|
19
|
-
|
20
15
|
config.after_initialize do
|
21
16
|
WebValve.setup
|
22
17
|
end
|
data/lib/webvalve/rspec.rb
CHANGED
data/lib/webvalve/version.rb
CHANGED
data/lib/webvalve.rb
CHANGED
@@ -10,11 +10,13 @@ module WebValve
|
|
10
10
|
# @see WebValve::Manager#register
|
11
11
|
# @!method allow_url
|
12
12
|
# @see WebValve::Manager#allow_url
|
13
|
-
# @!method reset
|
14
|
-
# @see WebValve::Manager#reset
|
13
|
+
# @!method reset!
|
14
|
+
# @see WebValve::Manager#reset!
|
15
|
+
# @!method clear!
|
16
|
+
# @see WebValve::Manager#clear!
|
15
17
|
# @!method enabled?
|
16
18
|
# @see WebValve::Manager#enabled?
|
17
|
-
delegate :setup, :register, :allow_url, :reset
|
19
|
+
delegate :setup, :register, :allow_url, :reset!, :clear!, :enabled?, to: :manager
|
18
20
|
attr_writer :logger
|
19
21
|
|
20
22
|
def config_paths
|
@@ -52,6 +54,15 @@ module WebValve
|
|
52
54
|
def manager
|
53
55
|
WebValve::Manager.instance
|
54
56
|
end
|
57
|
+
|
58
|
+
def reset
|
59
|
+
ActiveSupport::Deprecation.warn <<~WARN.squish
|
60
|
+
`WebValve.reset` is deprecated.
|
61
|
+
Please use `WebValve.clear!` (the old 'reset' behavior)
|
62
|
+
or `WebValve.reset!` (which also runs 'setup')
|
63
|
+
WARN
|
64
|
+
clear!
|
65
|
+
end
|
55
66
|
end
|
56
67
|
end
|
57
68
|
|
@@ -1,28 +1,8 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
require "active_record/railtie"
|
5
|
-
require "action_controller/railtie"
|
6
|
-
require "action_mailer/railtie"
|
7
|
-
require "action_view/railtie"
|
8
|
-
require "sprockets/railtie"
|
9
|
-
|
10
|
-
Bundler.require(*Rails.groups)
|
11
|
-
require "webvalve"
|
1
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
2
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
3
|
+
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__)
|
12
4
|
|
13
5
|
module Dummy
|
14
6
|
class Application < Rails::Application
|
15
|
-
# Settings in config/environments/* take precedence over those specified here.
|
16
|
-
# Application configuration should go into files in config/initializers
|
17
|
-
# -- all .rb files in that directory are automatically loaded.
|
18
|
-
|
19
|
-
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
|
20
|
-
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
|
21
|
-
# config.time_zone = 'Central Time (US & Canada)'
|
22
|
-
|
23
|
-
# The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
|
24
|
-
# config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
|
25
|
-
# config.i18n.default_locale = :de
|
26
7
|
end
|
27
8
|
end
|
28
|
-
|
data/spec/examples.txt
CHANGED
@@ -1,61 +1,68 @@
|
|
1
1
|
example_id | status | run_time |
|
2
2
|
-------------------------------------------------- | ------ | --------------- |
|
3
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:1] | passed | 0.
|
4
|
-
./spec/webvalve/fake_service_config_spec.rb[1:1:2] | passed | 0.
|
5
|
-
./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.
|
6
|
-
./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.
|
7
|
-
./spec/webvalve/fake_service_config_spec.rb[1:3:1] | passed | 0.
|
8
|
-
./spec/webvalve/fake_service_config_spec.rb[1:3:2] | passed | 0.
|
9
|
-
./spec/webvalve/fake_service_config_spec.rb[1:3:3] | passed | 0.
|
10
|
-
./spec/webvalve/
|
11
|
-
./spec/webvalve/
|
12
|
-
./spec/webvalve/
|
13
|
-
./spec/webvalve/
|
14
|
-
./spec/webvalve/
|
15
|
-
./spec/webvalve/
|
16
|
-
./spec/webvalve/
|
17
|
-
./spec/webvalve/
|
18
|
-
./spec/webvalve/manager_spec.rb[1:
|
19
|
-
./spec/webvalve/manager_spec.rb[1:
|
20
|
-
./spec/webvalve/manager_spec.rb[1:
|
21
|
-
./spec/webvalve/manager_spec.rb[1:
|
22
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
23
|
-
./spec/webvalve/manager_spec.rb[1:5:2:
|
24
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
25
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
26
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
27
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
28
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
29
|
-
./spec/webvalve/manager_spec.rb[1:5:
|
30
|
-
./spec/webvalve/manager_spec.rb[1:
|
31
|
-
./spec/webvalve/manager_spec.rb[1:
|
32
|
-
./spec/webvalve/manager_spec.rb[1:
|
33
|
-
./spec/webvalve/manager_spec.rb[1:
|
34
|
-
./spec/webvalve/manager_spec.rb[1:
|
35
|
-
./spec/webvalve/manager_spec.rb[1:
|
36
|
-
./spec/webvalve/manager_spec.rb[1:
|
37
|
-
./spec/webvalve/manager_spec.rb[1:6:
|
38
|
-
./spec/webvalve/manager_spec.rb[1:6:
|
39
|
-
./spec/webvalve/manager_spec.rb[1:6:
|
40
|
-
./spec/webvalve/manager_spec.rb[1:
|
41
|
-
./spec/webvalve/manager_spec.rb[1:
|
42
|
-
./spec/webvalve/manager_spec.rb[1:
|
43
|
-
./spec/webvalve/manager_spec.rb[1:
|
44
|
-
./spec/webvalve/manager_spec.rb[1:
|
45
|
-
./spec/webvalve/manager_spec.rb[1:
|
46
|
-
./spec/webvalve/manager_spec.rb[1:
|
47
|
-
./spec/webvalve/manager_spec.rb[1:7:
|
48
|
-
./spec/webvalve/manager_spec.rb[1:7:
|
49
|
-
./spec/webvalve/manager_spec.rb[1:7:
|
50
|
-
./spec/webvalve/manager_spec.rb[1:
|
51
|
-
./spec/webvalve/manager_spec.rb[1:
|
52
|
-
./spec/webvalve/manager_spec.rb[1:
|
53
|
-
./spec/webvalve/manager_spec.rb[1:
|
54
|
-
./spec/webvalve/manager_spec.rb[1:
|
55
|
-
./spec/webvalve/manager_spec.rb[1:
|
56
|
-
./spec/webvalve/manager_spec.rb[1:
|
57
|
-
./spec/webvalve/manager_spec.rb[1:8:
|
58
|
-
./spec/
|
59
|
-
./spec/
|
60
|
-
./spec/
|
61
|
-
./spec/
|
3
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:1] | passed | 0.00005 seconds |
|
4
|
+
./spec/webvalve/fake_service_config_spec.rb[1:1:2] | passed | 0.00009 seconds |
|
5
|
+
./spec/webvalve/fake_service_config_spec.rb[1:2:1] | passed | 0.00181 seconds |
|
6
|
+
./spec/webvalve/fake_service_config_spec.rb[1:2:2] | passed | 0.00007 seconds |
|
7
|
+
./spec/webvalve/fake_service_config_spec.rb[1:3:1] | passed | 0.00006 seconds |
|
8
|
+
./spec/webvalve/fake_service_config_spec.rb[1:3:2] | passed | 0.00004 seconds |
|
9
|
+
./spec/webvalve/fake_service_config_spec.rb[1:3:3] | passed | 0.00008 seconds |
|
10
|
+
./spec/webvalve/fake_service_config_spec.rb[1:4:1] | passed | 0.00006 seconds |
|
11
|
+
./spec/webvalve/fake_service_config_spec.rb[1:4:2] | passed | 0.00008 seconds |
|
12
|
+
./spec/webvalve/fake_service_config_spec.rb[1:4:3] | passed | 0.00007 seconds |
|
13
|
+
./spec/webvalve/fake_service_spec.rb[1:1] | passed | 0.00084 seconds |
|
14
|
+
./spec/webvalve/fake_service_spec.rb[1:2:1:1] | passed | 0.00096 seconds |
|
15
|
+
./spec/webvalve/fake_service_spec.rb[1:2:1:2] | passed | 0.00065 seconds |
|
16
|
+
./spec/webvalve/fake_service_spec.rb[1:2:2:1] | passed | 0.00145 seconds |
|
17
|
+
./spec/webvalve/fake_service_spec.rb[1:2:2:2] | passed | 0.00791 seconds |
|
18
|
+
./spec/webvalve/manager_spec.rb[1:1] | passed | 0.00002 seconds |
|
19
|
+
./spec/webvalve/manager_spec.rb[1:2:1] | passed | 0.00072 seconds |
|
20
|
+
./spec/webvalve/manager_spec.rb[1:3:1] | passed | 0.00012 seconds |
|
21
|
+
./spec/webvalve/manager_spec.rb[1:4:1] | passed | 0.00008 seconds |
|
22
|
+
./spec/webvalve/manager_spec.rb[1:5:1:1] | passed | 0.00011 seconds |
|
23
|
+
./spec/webvalve/manager_spec.rb[1:5:2:1] | passed | 0.00009 seconds |
|
24
|
+
./spec/webvalve/manager_spec.rb[1:5:2:2] | passed | 0.00018 seconds |
|
25
|
+
./spec/webvalve/manager_spec.rb[1:5:2:3] | passed | 0.0002 seconds |
|
26
|
+
./spec/webvalve/manager_spec.rb[1:5:2:4] | passed | 0.00021 seconds |
|
27
|
+
./spec/webvalve/manager_spec.rb[1:5:2:5] | passed | 0.00031 seconds |
|
28
|
+
./spec/webvalve/manager_spec.rb[1:5:2:6] | passed | 0.0002 seconds |
|
29
|
+
./spec/webvalve/manager_spec.rb[1:5:2:7] | passed | 0.00017 seconds |
|
30
|
+
./spec/webvalve/manager_spec.rb[1:5:2:8] | passed | 0.00032 seconds |
|
31
|
+
./spec/webvalve/manager_spec.rb[1:5:3:1:1] | passed | 0.00013 seconds |
|
32
|
+
./spec/webvalve/manager_spec.rb[1:5:3:2:1] | passed | 0.00019 seconds |
|
33
|
+
./spec/webvalve/manager_spec.rb[1:5:3:2:2] | passed | 0.00032 seconds |
|
34
|
+
./spec/webvalve/manager_spec.rb[1:5:3:2:3] | passed | 0.00092 seconds |
|
35
|
+
./spec/webvalve/manager_spec.rb[1:5:4:1] | passed | 0.0002 seconds |
|
36
|
+
./spec/webvalve/manager_spec.rb[1:5:4:2] | passed | 0.00036 seconds |
|
37
|
+
./spec/webvalve/manager_spec.rb[1:6:1:1] | passed | 0.00004 seconds |
|
38
|
+
./spec/webvalve/manager_spec.rb[1:6:1:2] | passed | 0.00012 seconds |
|
39
|
+
./spec/webvalve/manager_spec.rb[1:6:2:1] | passed | 0.00004 seconds |
|
40
|
+
./spec/webvalve/manager_spec.rb[1:6:2:2] | passed | 0.00012 seconds |
|
41
|
+
./spec/webvalve/manager_spec.rb[1:6:2:3] | passed | 0.00004 seconds |
|
42
|
+
./spec/webvalve/manager_spec.rb[1:6:3:1] | passed | 0.00004 seconds |
|
43
|
+
./spec/webvalve/manager_spec.rb[1:6:3:2] | passed | 0.00005 seconds |
|
44
|
+
./spec/webvalve/manager_spec.rb[1:6:3:3] | passed | 0.00006 seconds |
|
45
|
+
./spec/webvalve/manager_spec.rb[1:6:3:4] | passed | 0.00006 seconds |
|
46
|
+
./spec/webvalve/manager_spec.rb[1:6:3:5] | passed | 0.00005 seconds |
|
47
|
+
./spec/webvalve/manager_spec.rb[1:7:1:1] | passed | 0.00004 seconds |
|
48
|
+
./spec/webvalve/manager_spec.rb[1:7:1:2] | passed | 0.00305 seconds |
|
49
|
+
./spec/webvalve/manager_spec.rb[1:7:2:1] | passed | 0.00005 seconds |
|
50
|
+
./spec/webvalve/manager_spec.rb[1:7:2:2] | passed | 0.00014 seconds |
|
51
|
+
./spec/webvalve/manager_spec.rb[1:7:2:3] | passed | 0.00005 seconds |
|
52
|
+
./spec/webvalve/manager_spec.rb[1:7:3:1] | passed | 0.00004 seconds |
|
53
|
+
./spec/webvalve/manager_spec.rb[1:7:3:2] | passed | 0.00008 seconds |
|
54
|
+
./spec/webvalve/manager_spec.rb[1:7:3:3] | passed | 0.00004 seconds |
|
55
|
+
./spec/webvalve/manager_spec.rb[1:7:3:4] | passed | 0.00004 seconds |
|
56
|
+
./spec/webvalve/manager_spec.rb[1:7:3:5] | passed | 0.00004 seconds |
|
57
|
+
./spec/webvalve/manager_spec.rb[1:8:1:1] | passed | 0.00003 seconds |
|
58
|
+
./spec/webvalve/manager_spec.rb[1:8:1:2] | passed | 0.00012 seconds |
|
59
|
+
./spec/webvalve/manager_spec.rb[1:8:2:1] | passed | 0.00004 seconds |
|
60
|
+
./spec/webvalve/manager_spec.rb[1:8:2:2] | passed | 0.00013 seconds |
|
61
|
+
./spec/webvalve/manager_spec.rb[1:8:3:1] | passed | 0.00003 seconds |
|
62
|
+
./spec/webvalve/manager_spec.rb[1:8:3:2] | passed | 0.00005 seconds |
|
63
|
+
./spec/webvalve/manager_spec.rb[1:8:3:3] | passed | 0.00004 seconds |
|
64
|
+
./spec/webvalve/manager_spec.rb[1:8:3:4] | passed | 0.00004 seconds |
|
65
|
+
./spec/webvalve_spec.rb[1:1] | passed | 0.00062 seconds |
|
66
|
+
./spec/webvalve_spec.rb[1:2] | passed | 0.00003 seconds |
|
67
|
+
./spec/webvalve_spec.rb[1:3] | passed | 0.00002 seconds |
|
68
|
+
./spec/webvalve_spec.rb[1:4] | passed | 0.00002 seconds |
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
ENV['RAILS_ENV'] ||= 'test'
|
2
|
-
require
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.require :default, :development
|
4
|
+
require File.expand_path('dummy/config/application', __dir__) if ENV['BUNDLE_GEMFILE'] =~ /rails/
|
3
5
|
require 'rspec'
|
4
6
|
require 'pry'
|
5
7
|
require 'webvalve'
|
@@ -141,6 +141,21 @@ RSpec.describe WebValve::Manager do
|
|
141
141
|
expect { subject.setup }.to raise_error('Invalid config for FakeOtherThing. Already stubbed url http://something.dev')
|
142
142
|
end
|
143
143
|
end
|
144
|
+
|
145
|
+
it 'does not raise with different HTTP auth patterns' do
|
146
|
+
disabled_service = class_double(WebValve::FakeService, name: 'FakeSomething')
|
147
|
+
other_disabled_service = class_double(WebValve::FakeService, name: 'FakeOtherThing')
|
148
|
+
web_mock_stubble = double(to_rack: true)
|
149
|
+
allow(WebMock).to receive(:stub_request).and_return(web_mock_stubble)
|
150
|
+
|
151
|
+
with_env 'SOMETHING_API_URL' => 'http://user1@something.dev', 'OTHER_THING_API_URL' => 'http://user2@something.dev' do
|
152
|
+
subject.register disabled_service.name
|
153
|
+
subject.register other_disabled_service.name
|
154
|
+
|
155
|
+
expect { subject.setup }.to_not raise_error
|
156
|
+
expect(WebMock).to have_received(:stub_request).with(:any, %r{\Ahttp://something\.dev}).twice
|
157
|
+
end
|
158
|
+
end
|
144
159
|
end
|
145
160
|
|
146
161
|
context 'when WebValve is on and allowing traffic' do
|
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: 1.
|
4
|
+
version: 1.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sam Moore
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-12-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.2.0
|
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
|
-
version:
|
26
|
+
version: 5.2.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: sinatra
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -134,6 +134,20 @@ dependencies:
|
|
134
134
|
- - ">="
|
135
135
|
- !ruby/object:Gem::Version
|
136
136
|
version: '0'
|
137
|
+
- !ruby/object:Gem::Dependency
|
138
|
+
name: rails
|
139
|
+
requirement: !ruby/object:Gem::Requirement
|
140
|
+
requirements:
|
141
|
+
- - ">="
|
142
|
+
- !ruby/object:Gem::Version
|
143
|
+
version: '0'
|
144
|
+
type: :development
|
145
|
+
prerelease: false
|
146
|
+
version_requirements: !ruby/object:Gem::Requirement
|
147
|
+
requirements:
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: '0'
|
137
151
|
description: Betterment's library for developing and testing service-oriented apps
|
138
152
|
in isolation with WebMock and Sinatra-based fakes.
|
139
153
|
email:
|
@@ -160,45 +174,11 @@ files:
|
|
160
174
|
- lib/webvalve/railtie.rb
|
161
175
|
- lib/webvalve/rspec.rb
|
162
176
|
- lib/webvalve/version.rb
|
163
|
-
- spec/dummy/README.rdoc
|
164
|
-
- spec/dummy/Rakefile
|
165
|
-
- spec/dummy/app/assets/config/manifest.js
|
166
|
-
- spec/dummy/app/assets/javascripts/application.js
|
167
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
168
|
-
- spec/dummy/app/controllers/application_controller.rb
|
169
|
-
- spec/dummy/app/helpers/application_helper.rb
|
170
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
171
|
-
- spec/dummy/bin/bundle
|
172
|
-
- spec/dummy/bin/rails
|
173
|
-
- spec/dummy/bin/rake
|
174
|
-
- spec/dummy/bin/setup
|
175
|
-
- spec/dummy/config.ru
|
176
177
|
- spec/dummy/config/application.rb
|
177
|
-
- spec/dummy/config/boot.rb
|
178
|
-
- spec/dummy/config/database.yml
|
179
|
-
- spec/dummy/config/environment.rb
|
180
|
-
- spec/dummy/config/environments/development.rb
|
181
|
-
- spec/dummy/config/environments/production.rb
|
182
|
-
- spec/dummy/config/environments/test.rb
|
183
|
-
- spec/dummy/config/initializers/assets.rb
|
184
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
185
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
186
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
187
|
-
- spec/dummy/config/initializers/inflections.rb
|
188
|
-
- spec/dummy/config/initializers/mime_types.rb
|
189
|
-
- spec/dummy/config/initializers/session_store.rb
|
190
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
191
|
-
- spec/dummy/config/locales/en.yml
|
192
|
-
- spec/dummy/config/routes.rb
|
193
|
-
- spec/dummy/config/secrets.yml
|
194
|
-
- spec/dummy/log/test.log
|
195
|
-
- spec/dummy/public/404.html
|
196
|
-
- spec/dummy/public/422.html
|
197
|
-
- spec/dummy/public/500.html
|
198
|
-
- spec/dummy/public/favicon.ico
|
199
178
|
- spec/examples.txt
|
200
179
|
- spec/spec_helper.rb
|
201
180
|
- spec/support/helpers.rb
|
181
|
+
- spec/support/rails_root.rb
|
202
182
|
- spec/webvalve/fake_service_config_spec.rb
|
203
183
|
- spec/webvalve/fake_service_spec.rb
|
204
184
|
- spec/webvalve/manager_spec.rb
|
@@ -206,7 +186,8 @@ files:
|
|
206
186
|
homepage: https://github.com/Betterment/webvalve
|
207
187
|
licenses:
|
208
188
|
- MIT
|
209
|
-
metadata:
|
189
|
+
metadata:
|
190
|
+
rubygems_mfa_required: 'true'
|
210
191
|
post_install_message:
|
211
192
|
rdoc_options: []
|
212
193
|
require_paths:
|
@@ -215,58 +196,24 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
215
196
|
requirements:
|
216
197
|
- - ">="
|
217
198
|
- !ruby/object:Gem::Version
|
218
|
-
version:
|
199
|
+
version: 2.6.0
|
219
200
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
220
201
|
requirements:
|
221
202
|
- - ">="
|
222
203
|
- !ruby/object:Gem::Version
|
223
204
|
version: '0'
|
224
205
|
requirements: []
|
225
|
-
rubygems_version: 3.1.
|
206
|
+
rubygems_version: 3.1.6
|
226
207
|
signing_key:
|
227
208
|
specification_version: 4
|
228
209
|
summary: A library for faking http service integrations in development and test
|
229
210
|
test_files:
|
230
211
|
- spec/spec_helper.rb
|
231
|
-
- spec/dummy/app/controllers/application_controller.rb
|
232
|
-
- spec/dummy/app/views/layouts/application.html.erb
|
233
|
-
- spec/dummy/app/assets/config/manifest.js
|
234
|
-
- spec/dummy/app/assets/javascripts/application.js
|
235
|
-
- spec/dummy/app/assets/stylesheets/application.css
|
236
|
-
- spec/dummy/app/helpers/application_helper.rb
|
237
|
-
- spec/dummy/bin/rake
|
238
|
-
- spec/dummy/bin/setup
|
239
|
-
- spec/dummy/bin/bundle
|
240
|
-
- spec/dummy/bin/rails
|
241
|
-
- spec/dummy/config/secrets.yml
|
242
|
-
- spec/dummy/config/routes.rb
|
243
|
-
- spec/dummy/config/locales/en.yml
|
244
|
-
- spec/dummy/config/environments/production.rb
|
245
|
-
- spec/dummy/config/environments/development.rb
|
246
|
-
- spec/dummy/config/environments/test.rb
|
247
|
-
- spec/dummy/config/environment.rb
|
248
212
|
- spec/dummy/config/application.rb
|
249
|
-
- spec/dummy/config/database.yml
|
250
|
-
- spec/dummy/config/boot.rb
|
251
|
-
- spec/dummy/config/initializers/backtrace_silencers.rb
|
252
|
-
- spec/dummy/config/initializers/mime_types.rb
|
253
|
-
- spec/dummy/config/initializers/filter_parameter_logging.rb
|
254
|
-
- spec/dummy/config/initializers/session_store.rb
|
255
|
-
- spec/dummy/config/initializers/wrap_parameters.rb
|
256
|
-
- spec/dummy/config/initializers/assets.rb
|
257
|
-
- spec/dummy/config/initializers/cookies_serializer.rb
|
258
|
-
- spec/dummy/config/initializers/inflections.rb
|
259
|
-
- spec/dummy/config.ru
|
260
|
-
- spec/dummy/Rakefile
|
261
|
-
- spec/dummy/public/favicon.ico
|
262
|
-
- spec/dummy/public/422.html
|
263
|
-
- spec/dummy/public/500.html
|
264
|
-
- spec/dummy/public/404.html
|
265
|
-
- spec/dummy/log/test.log
|
266
|
-
- spec/dummy/README.rdoc
|
267
213
|
- spec/examples.txt
|
268
214
|
- spec/webvalve/fake_service_spec.rb
|
269
215
|
- spec/webvalve/fake_service_config_spec.rb
|
270
216
|
- spec/webvalve/manager_spec.rb
|
271
217
|
- spec/webvalve_spec.rb
|
272
218
|
- spec/support/helpers.rb
|
219
|
+
- spec/support/rails_root.rb
|
data/spec/dummy/README.rdoc
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
== README
|
2
|
-
|
3
|
-
This README would normally document whatever steps are necessary to get the
|
4
|
-
application up and running.
|
5
|
-
|
6
|
-
Things you may want to cover:
|
7
|
-
|
8
|
-
* Ruby version
|
9
|
-
|
10
|
-
* System dependencies
|
11
|
-
|
12
|
-
* Configuration
|
13
|
-
|
14
|
-
* Database creation
|
15
|
-
|
16
|
-
* Database initialization
|
17
|
-
|
18
|
-
* How to run the test suite
|
19
|
-
|
20
|
-
* Services (job queues, cache servers, search engines, etc.)
|
21
|
-
|
22
|
-
* Deployment instructions
|
23
|
-
|
24
|
-
* ...
|
25
|
-
|
26
|
-
|
27
|
-
Please feel free to use a different markup language if you do not plan to run
|
28
|
-
<tt>rake doc:app</tt>.
|
data/spec/dummy/Rakefile
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
2
|
-
// listed below.
|
3
|
-
//
|
4
|
-
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
5
|
-
// or any plugin's vendor/assets/javascripts directory can be referenced here using a relative path.
|
6
|
-
//
|
7
|
-
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
8
|
-
// compiled file.
|
9
|
-
//
|
10
|
-
// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
|
11
|
-
// about supported directives.
|
12
|
-
//
|
13
|
-
//= require_tree .
|