rspec-webservice_matchers 4.1.2 → 4.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5ccbc925ba70b2fddb0c1b6776ff354b7b657d2f
|
4
|
+
data.tar.gz: b46de035aabfe0a31d25ad93a6b08e19f2ca1082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a847e62a9941b08faf2c9621a53c0cd5a81959ae4a3c838aa7014ba851d32244fed4410879c0596cb415a504329177c22db4734edf5a089c47f2766fe31dcd2
|
7
|
+
data.tar.gz: 6c08b056cdb287de5f15994edf52780f8e2bd7d9d9575c1e4875d8542310617f793757e61849108dc2ba6da4f49d78425b8084775ff4cff71626143e0109b0f2
|
data/.gitignore
CHANGED
data/README.md
CHANGED
@@ -13,6 +13,8 @@ It's a tool for doing **Test Driven Devops** (I just made that up). See [the int
|
|
13
13
|
|
14
14
|
This library takes a minimalist approach: it simply adds new RSpec matchers. Therefore, you can use your own RSpec writing style; there's no new DSL to learn.
|
15
15
|
|
16
|
+
If you're too busy to install this and code the tests by hand, you can try the [new hosted service which runs these RSpec matchers in the cloud](http://nonstop.qa).
|
17
|
+
|
16
18
|
|
17
19
|
Installation
|
18
20
|
------------
|
@@ -11,7 +11,7 @@ module RSpec
|
|
11
11
|
begin
|
12
12
|
Util.try_ssl_connection(domain_name_or_url)
|
13
13
|
rescue Exception => e
|
14
|
-
error_message = e.message
|
14
|
+
error_message = fix_for_excon_bug(e.message)
|
15
15
|
false
|
16
16
|
end
|
17
17
|
end
|
@@ -19,6 +19,19 @@ module RSpec
|
|
19
19
|
failure_message do
|
20
20
|
error_message
|
21
21
|
end
|
22
|
+
|
23
|
+
# Excon is failing on SSL when a 302 (and possibly others) is received.
|
24
|
+
# We should be able to verify the SSL cert even though it's not a
|
25
|
+
# 200. HTTPie and Curl are able to.
|
26
|
+
# See https://github.com/excon/excon/issues/546
|
27
|
+
def fix_for_excon_bug(error_message)
|
28
|
+
return error_message unless buggy_excon_message?(error_message)
|
29
|
+
'Unable to verify the certificate because a redirect was detected'
|
30
|
+
end
|
31
|
+
|
32
|
+
def buggy_excon_message?(text)
|
33
|
+
text =~ /Unable to verify certificate, please/
|
34
|
+
end
|
22
35
|
end
|
23
36
|
end
|
24
37
|
end
|
@@ -26,6 +26,13 @@ describe 'have_a_valid_cert matcher' do
|
|
26
26
|
}.to fail_matching(/not known/i)
|
27
27
|
end
|
28
28
|
|
29
|
+
it "provides a good error message when it's a redirect" do
|
30
|
+
expect {
|
31
|
+
# Can't figure out how to do this with WebMock.
|
32
|
+
expect('bloc.io').to have_a_valid_cert
|
33
|
+
}.to fail_matching(/redirect/i)
|
34
|
+
end
|
35
|
+
|
29
36
|
# TODO: Find a good way to test this.
|
30
37
|
# it 'provides a good error message if the request times out' do
|
31
38
|
# expect {
|
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.1.
|
4
|
+
version: 4.1.3
|
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-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|