rspec-webservice_matchers 4.1.2 → 4.1.3

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: faea56877146d051fb37a6e94bff67aad902cbf5
4
- data.tar.gz: d62fa5bbc3db07e0a6b7777203d479b2bba9a269
3
+ metadata.gz: 5ccbc925ba70b2fddb0c1b6776ff354b7b657d2f
4
+ data.tar.gz: b46de035aabfe0a31d25ad93a6b08e19f2ca1082
5
5
  SHA512:
6
- metadata.gz: 7c294537b29a879e8ef8c8d7826509e970af58112a919d449dc06b50e53caa79cd504411ee190bc3207272fc0736e2ca85e0bfc36a4576ae02c7d7d4430c10cc
7
- data.tar.gz: 87a9baebca93b647c705f4db6009c49596024c544243485a4593820f0c741c98d8d52135c07ffe853d5db3d265d8d03e319f680d9f8ddac0160d47693ffcf60f
6
+ metadata.gz: 4a847e62a9941b08faf2c9621a53c0cd5a81959ae4a3c838aa7014ba851d32244fed4410879c0596cb415a504329177c22db4734edf5a089c47f2766fe31dcd2
7
+ data.tar.gz: 6c08b056cdb287de5f15994edf52780f8e2bd7d9d9575c1e4875d8542310617f793757e61849108dc2ba6da4f49d78425b8084775ff4cff71626143e0109b0f2
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  .bundle
6
6
  .config
7
7
  .yardoc
8
+ .ruby-version
8
9
  Gemfile.lock
9
10
  InstalledFiles
10
11
  _yardoc
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
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module WebserviceMatchers
3
- VERSION = '4.1.2'
3
+ VERSION = '4.1.3'
4
4
  end
5
5
  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.2
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-01-31 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler