proxy_rb 0.10.5 → 0.10.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/History.md +3 -5
- data/Rakefile +1 -1
- data/lib/proxy_rb/http_proxy.rb +6 -1
- data/lib/proxy_rb/main.rb +7 -7
- data/lib/proxy_rb/matchers/be_forbidden.rb +10 -10
- data/lib/proxy_rb/matchers/be_successful.rb +10 -10
- data/lib/proxy_rb/matchers/have_mime_type.rb +10 -10
- data/lib/proxy_rb/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e46872c1598f6d391255a8f82bd45af392b85a62
|
4
|
+
data.tar.gz: b6f0b8b2255df3f30b8fb1ae856dcc975b9066d8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 298bf3a4892cb3da76e5eec56da220208ff17dec2b1552080fa40d393507bb347b5d25d133ba88a0e7d301be9c0e65aa9309e4d78888340779c22934c2d4914b
|
7
|
+
data.tar.gz: 5c8ac7581a493ce157398615e738e66b164202926ace2cc1f332a98783500f383b43b9757d4a5f1e4bc7215a2c56b2205f370a55fe3a6b73e501de20ff105676
|
data/History.md
CHANGED
@@ -1,10 +1,8 @@
|
|
1
|
-
|
1
|
+
## [v0.10.6](https://github.com/fedux-org/proxy_rb/compare/v0.10.5...v0.10.6)
|
2
2
|
|
3
|
-
|
3
|
+
* Fix error message in matchers: The user name was missing
|
4
4
|
|
5
|
-
|
6
|
-
|
7
|
-
## [v0.10.5](https://github.com/fedux-org/proxy_rb/compare/v0.10.5...v0.10.5)
|
5
|
+
## [v0.10.5](https://github.com/fedux-org/proxy_rb/compare/v0.10.4...v0.10.5)
|
8
6
|
|
9
7
|
* Fix for overwriting proxies
|
10
8
|
* Better error messages for matchers
|
data/Rakefile
CHANGED
data/lib/proxy_rb/http_proxy.rb
CHANGED
@@ -48,7 +48,12 @@ module ProxyRb
|
|
48
48
|
# @return [ProxyUrl]
|
49
49
|
# The proxy as url
|
50
50
|
def full_url
|
51
|
-
ProxyUrl.build
|
51
|
+
ProxyUrl.build(
|
52
|
+
url.to_hash.merge(
|
53
|
+
user: credentials.user_name,
|
54
|
+
password: credentials.password
|
55
|
+
)
|
56
|
+
)
|
52
57
|
end
|
53
58
|
|
54
59
|
# Convert proxy to string
|
data/lib/proxy_rb/main.rb
CHANGED
@@ -7,13 +7,13 @@ module ProxyRb
|
|
7
7
|
@logger = Logger.new($stderr)
|
8
8
|
|
9
9
|
ANNOUNCERS = %i(
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
)
|
10
|
+
proxy
|
11
|
+
proxy_user
|
12
|
+
resource
|
13
|
+
resource_user
|
14
|
+
http_response_headers
|
15
|
+
status_code
|
16
|
+
).freeze
|
17
17
|
|
18
18
|
class << self
|
19
19
|
protected
|
@@ -12,11 +12,11 @@ RSpec::Matchers.define :be_forbidden do
|
|
12
12
|
|
13
13
|
msg << %(expected that response of "#{resource}" has status code 403, but has #{actual.status_code}.)
|
14
14
|
|
15
|
-
if proxy.nil? || proxy.empty?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
msg << if proxy.nil? || proxy.empty?
|
16
|
+
%(No proxy was used.)
|
17
|
+
else
|
18
|
+
%(It was fetched via proxy "#{proxy}".)
|
19
|
+
end
|
20
20
|
|
21
21
|
msg.join ' '
|
22
22
|
end
|
@@ -26,11 +26,11 @@ RSpec::Matchers.define :be_forbidden do
|
|
26
26
|
|
27
27
|
msg << %(expected that response of "#{resource}" does not have status code 403.)
|
28
28
|
|
29
|
-
if proxy.nil? || proxy.empty?
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
msg << if proxy.nil? || proxy.empty?
|
30
|
+
%(No proxy was used.)
|
31
|
+
else
|
32
|
+
%(It was fetched via proxy "#{proxy}".)
|
33
|
+
end
|
34
34
|
|
35
35
|
msg.join ' '
|
36
36
|
end
|
@@ -12,11 +12,11 @@ RSpec::Matchers.define :be_successful do
|
|
12
12
|
|
13
13
|
msg << %(expected that response of "#{resource}" has status code 2xx, but has #{actual.status_code}.)
|
14
14
|
|
15
|
-
if proxy.nil? || proxy.empty?
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
15
|
+
msg << if proxy.nil? || proxy.empty?
|
16
|
+
%(No proxy was used.)
|
17
|
+
else
|
18
|
+
%(It was fetched via proxy "#{proxy}".)
|
19
|
+
end
|
20
20
|
|
21
21
|
msg.join ' '
|
22
22
|
end
|
@@ -26,11 +26,11 @@ RSpec::Matchers.define :be_successful do
|
|
26
26
|
|
27
27
|
msg << %(expected that response of "#{resource}" does not have status code 2xx.)
|
28
28
|
|
29
|
-
if proxy.nil? || proxy.empty?
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
29
|
+
msg << if proxy.nil? || proxy.empty?
|
30
|
+
%(No proxy was used.)
|
31
|
+
else
|
32
|
+
%(It was fetched via proxy "#{proxy}".)
|
33
|
+
end
|
34
34
|
|
35
35
|
msg.join ' '
|
36
36
|
end
|
@@ -10,11 +10,11 @@ RSpec::Matchers.define :have_mime_type do |expected|
|
|
10
10
|
|
11
11
|
msg << %(expected that response of "#{resource}" has mime type "#{expected}", but has "#{actual}".)
|
12
12
|
|
13
|
-
if proxy.nil? || proxy.empty?
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
msg << if proxy.nil? || proxy.empty?
|
14
|
+
%(No proxy was used.)
|
15
|
+
else
|
16
|
+
%(It was fetched via proxy "#{proxy}".)
|
17
|
+
end
|
18
18
|
|
19
19
|
msg.join ' '
|
20
20
|
end
|
@@ -24,11 +24,11 @@ RSpec::Matchers.define :have_mime_type do |expected|
|
|
24
24
|
|
25
25
|
msg << %(expected that response of "#{resource}" does not have mime type "#{expected}".)
|
26
26
|
|
27
|
-
if proxy.nil? || proxy.empty?
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
27
|
+
msg << if proxy.nil? || proxy.empty?
|
28
|
+
%(No proxy was used.)
|
29
|
+
else
|
30
|
+
%(It was fetched via proxy "#{proxy}".)
|
31
|
+
end
|
32
32
|
|
33
33
|
msg.join ' '
|
34
34
|
end
|
data/lib/proxy_rb/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: proxy_rb
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Max Meyer
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -223,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
223
|
version: '0'
|
224
224
|
requirements: []
|
225
225
|
rubyforge_project:
|
226
|
-
rubygems_version: 2.
|
226
|
+
rubygems_version: 2.6.3
|
227
227
|
signing_key:
|
228
228
|
specification_version: 4
|
229
229
|
summary: This gem makes testing your proxy easy.
|