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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 10271047f0647b3f8bf5aeafbe665214615807f3
4
- data.tar.gz: 8ad50cfcf15f9b85b528301fe04daf34e0f29b58
3
+ metadata.gz: d1aef515c1aac674c133b8684f31f3ada36751fe
4
+ data.tar.gz: 02273fdbd1225c5b7976784816c48a6dcfe8c6ab
5
5
  SHA512:
6
- metadata.gz: 920c4cf683f0c68f552ad8b4cc3d03eb6ad9253d44c97e094f0e8047b313906bd61b254f5e69730199a01f2e327c50f01ee618a96b39643a112dc89b380b3bf3
7
- data.tar.gz: 23e9d8e71ed8c1915071cc37e9061ec9627f372917eb06de06fdc149ff60fc72d30ab52cf7910232512a1cab2f7cc9ee6d7f02274becb64fe5c3968af8a57cdb
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 = Faraday.new do |c|
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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module WebserviceMatchers
3
- VERSION = "1.3.0"
3
+ VERSION = "1.3.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-webservice_matchers
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robb Shecter