rspec-webservice_matchers 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec/webservice_matchers.rb +5 -7
- data/lib/rspec/webservice_matchers/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d1aef515c1aac674c133b8684f31f3ada36751fe
|
4
|
+
data.tar.gz: 02273fdbd1225c5b7976784816c48a6dcfe8c6ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ecc4f32d6450bb6846df978954a9b591c96dd035f66b20119d72e82e90cacec39801e5bd4dc2104aaf261ed4c81c634c1901b155e0e268394146ec641ab2dd64
|
7
|
+
data.tar.gz: 850444078a34d72744732ad3beff1966fdd7844d03518681f6c5656b9e653be616daef5e02aaf1d6bba5063e58581b0fc0ec1612904f9181b66d9b53e2aa581b
|
@@ -88,12 +88,7 @@ module RSpec
|
|
88
88
|
RSpec::Matchers.define :be_up do
|
89
89
|
match do |url_or_domain_name|
|
90
90
|
url = RSpec::WebserviceMatchers.make_url(url_or_domain_name)
|
91
|
-
conn =
|
92
|
-
c.options[:timeout] = TIMEOUT
|
93
|
-
c.options[:open_timeout] = TIMEOUT
|
94
|
-
c.use FaradayMiddleware::FollowRedirects, limit: 5
|
95
|
-
c.adapter :net_http
|
96
|
-
end
|
91
|
+
conn = RSpec::WebserviceMatchers.connection(follow: true)
|
97
92
|
response = conn.head(url)
|
98
93
|
response.status == 200
|
99
94
|
end
|
@@ -102,10 +97,13 @@ module RSpec
|
|
102
97
|
|
103
98
|
private
|
104
99
|
|
105
|
-
def self.connection
|
100
|
+
def self.connection(follow: false)
|
106
101
|
Faraday.new do |c|
|
107
102
|
c.options[:timeout] = TIMEOUT
|
108
103
|
c.options[:open_timeout] = TIMEOUT
|
104
|
+
if follow
|
105
|
+
c.use FaradayMiddleware::FollowRedirects, limit: 4
|
106
|
+
end
|
109
107
|
c.adapter :net_http
|
110
108
|
end
|
111
109
|
end
|