rspec-webservice_matchers 4.5.0 → 4.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +1 -0
- data/HISTORY.md +5 -0
- data/Rakefile +2 -1
- data/lib/rspec/webservice_matchers.rb +1 -0
- data/lib/rspec/webservice_matchers/be_fast.rb +1 -0
- data/lib/rspec/webservice_matchers/be_status.rb +1 -0
- data/lib/rspec/webservice_matchers/be_up.rb +1 -0
- data/lib/rspec/webservice_matchers/enforce_https_everywhere.rb +2 -1
- data/lib/rspec/webservice_matchers/have_a_valid_cert.rb +1 -0
- data/lib/rspec/webservice_matchers/redirect_helpers.rb +1 -0
- data/lib/rspec/webservice_matchers/redirect_permanently_to.rb +1 -0
- data/lib/rspec/webservice_matchers/redirect_temporarily_to.rb +1 -0
- data/lib/rspec/webservice_matchers/util.rb +2 -1
- data/lib/rspec/webservice_matchers/version.rb +2 -1
- data/rspec-webservice_matchers.gemspec +1 -0
- data/spec/rspec/webservice_matchers/page_speed_spec.rb +1 -0
- data/spec/rspec/webservice_matchers/protcol_spec.rb +1 -0
- data/spec/rspec/webservice_matchers/public_api_spec.rb +1 -0
- data/spec/rspec/webservice_matchers/redirect_spec.rb +1 -0
- data/spec/rspec/webservice_matchers/ssl_spec.rb +2 -1
- data/spec/spec_helper.rb +10 -9
- 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: 0f78401e84678f7f624bfa448b483d50dd05927b
|
4
|
+
data.tar.gz: f2f69dec3dc9ca7b5f3feae23964c9be536c1600
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f71b8211be319c077820c50183ce6a5b0bd28081f0a0ce8effa2a40af23b8f73639080aee84aa24191e3cfe84ead11a2cdf7b125273a0a3cd2cb6a6a0cc88dae
|
7
|
+
data.tar.gz: c7ffeb5bde032a4cc8721670d8bb6488aa8108d6b2e8854371c9057c54de1ea12de95c55ad81243e4d1e82af4f6f95f46107d32aa5f4f0db45d8e74d2d62ad4e
|
data/Gemfile
CHANGED
data/HISTORY.md
CHANGED
data/Rakefile
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'faraday'
|
2
3
|
require 'rspec/webservice_matchers/util'
|
3
4
|
require 'rspec/webservice_matchers/redirect_helpers'
|
@@ -27,7 +28,7 @@ module RSpec
|
|
27
28
|
status, headers = Util.head(domain_name)
|
28
29
|
location = headers['location']
|
29
30
|
/^(https?)/ =~ location
|
30
|
-
protocol =
|
31
|
+
protocol = Regexp.last_match(1) || nil
|
31
32
|
[status, location, protocol]
|
32
33
|
end
|
33
34
|
|
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'spec_helper'
|
2
3
|
require 'rspec/webservice_matchers'
|
3
4
|
|
@@ -11,7 +12,7 @@ describe 'have_a_valid_cert matcher' do
|
|
11
12
|
it 'fails if the server is not serving SSL at all' do
|
12
13
|
expect {
|
13
14
|
expect('www.psu.edu').to have_a_valid_cert
|
14
|
-
}.to
|
15
|
+
}.to fail_matching(/443/)
|
15
16
|
end
|
16
17
|
|
17
18
|
it 'provides a relevant error message' do
|
data/spec/spec_helper.rb
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
# frozen_string_literal: true
|
1
2
|
require 'webmock/rspec'
|
2
3
|
|
3
4
|
RSpec.configure do |config|
|
@@ -12,13 +13,13 @@ RSpec.configure do |config|
|
|
12
13
|
WebMock.stub_request(:get, 'appengine.com').to_return(status: 200)
|
13
14
|
|
14
15
|
WebMock.stub_request(:any, 'perm-redirector.com')
|
15
|
-
|
16
|
+
.to_return(status: 301, headers: { Location: 'http://www.website.com/' })
|
16
17
|
|
17
18
|
WebMock.stub_request(:any, 'temp-redirector.org')
|
18
|
-
|
19
|
+
.to_return(status: 302, headers: { Location: 'http://a-page.com/a/page.txt' })
|
19
20
|
|
20
21
|
WebMock.stub_request(:any, 'temp-307-redirector.net')
|
21
|
-
|
22
|
+
.to_return(status: 307, headers: { Location: 'http://a-page.com/a/page.txt' })
|
22
23
|
|
23
24
|
# Timeout scenarios
|
24
25
|
WebMock.stub_request(:any, 'www.timeout.com').to_timeout
|
@@ -26,12 +27,12 @@ RSpec.configure do |config|
|
|
26
27
|
|
27
28
|
# Insights API
|
28
29
|
key = ENV['WEBSERVICE_MATCHER_INSIGHTS_KEY']
|
29
|
-
WebMock.stub_request(:get, "https://www.googleapis.com/pagespeedonline/v2/runPagespeed?key=#{key}&screenshot=false&url=http://nonstop.qa")
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
30
|
+
WebMock.stub_request(:get, "https://www.googleapis.com/pagespeedonline/v2/runPagespeed?key=#{key}&screenshot=false&url=http://nonstop.qa")
|
31
|
+
.with(headers: { 'Accept' => '*/*', 'Accept-Encoding' => 'gzip;q=1.0,deflate;q=0.6,identity;q=0.3', 'User-Agent' => 'Faraday v0.9.2' })
|
32
|
+
.to_return(
|
33
|
+
status: 200,
|
34
|
+
body: IO.read('spec/fixtures/pagespeed.json'),
|
35
|
+
headers: {})
|
35
36
|
|
36
37
|
WebMock.allow_net_connect!
|
37
38
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-webservice_matchers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.
|
4
|
+
version: 4.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Robb Shecter
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-03-
|
11
|
+
date: 2016-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -161,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
161
161
|
version: '0'
|
162
162
|
requirements: []
|
163
163
|
rubyforge_project:
|
164
|
-
rubygems_version: 2.
|
164
|
+
rubygems_version: 2.6.2
|
165
165
|
signing_key:
|
166
166
|
specification_version: 4
|
167
167
|
summary: Black-box web app configuration testing
|