rspec-webservice_matchers 4.1.1 → 4.1.2

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: 8651a565b58e694aaded1c7e89faf9ee79f2b020
4
- data.tar.gz: 1cf00d26f4cd5dd7f3e7697429f2662b316012ae
3
+ metadata.gz: faea56877146d051fb37a6e94bff67aad902cbf5
4
+ data.tar.gz: d62fa5bbc3db07e0a6b7777203d479b2bba9a269
5
5
  SHA512:
6
- metadata.gz: 5c6e385cbee4b154cfd367270e4dad775cf2028a142f70481e4f70a22f3e20cdba3831f850e0b78dbaef2ae2aeb49c3ed6234e1625e51686d7143224d91d813a
7
- data.tar.gz: a95d2c497c4023d43a8501574e38817e5ae97a3abc18ac4fc14ad9bd99bf35f9e70daa2d9df64a9ccab95b6d68177b371eeb2195247adfc04f4c4bc09dfc1c46
6
+ metadata.gz: 7c294537b29a879e8ef8c8d7826509e970af58112a919d449dc06b50e53caa79cd504411ee190bc3207272fc0736e2ca85e0bfc36a4576ae02c7d7d4430c10cc
7
+ data.tar.gz: 87a9baebca93b647c705f4db6009c49596024c544243485a4593820f0c741c98d8d52135c07ffe853d5db3d265d8d03e319f680d9f8ddac0160d47693ffcf60f
data/README.md CHANGED
@@ -3,7 +3,13 @@
3
3
  [![Gem Version](https://badge.fury.io/rb/rspec-webservice_matchers.png)](http://badge.fury.io/rb/rspec-webservice_matchers) [![Code Climate](https://codeclimate.com/github/dogweather/rspec-webservice_matchers.png)](https://codeclimate.com/github/dogweather/rspec-webservice_matchers)
4
4
 
5
5
 
6
- A [gem](https://rubygems.org/gems/rspec-webservice_matchers) to black-box test a web server configuration. For example, whether a site's SSL certificate is correctly configured and not expired. It's a tool for doing **Test Driven Devops** (I just made that up). See [the introductory blog post](http://robb.weblaws.org/2014/01/16/new-open-source-library-for-test-driven-devops/) for more about my motivations.
6
+ A [gem](https://rubygems.org/gems/rspec-webservice_matchers) to black-box test a web server configuration. For example, whether a site's SSL certificate is correctly configured and not expired:
7
+
8
+ ```ruby
9
+ expect('github.com').to have_a_valid_cert
10
+ ```
11
+
12
+ It's a tool for doing **Test Driven Devops** (I just made that up). See [the introductory blog post](http://robb.weblaws.org/2014/01/16/new-open-source-library-for-test-driven-devops/) for more about my motivations.
7
13
 
8
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.
9
15
 
@@ -58,5 +64,6 @@ end
58
64
 
59
65
  Related Projects
60
66
  ----------------
67
+ * [json-schema-rspec](https://github.com/sharethrough/json-schema-rspec)
61
68
  * [serverspec](http://serverspec.org)
62
69
  * [HTTP Assertions](https://github.com/dogweather/HTTP-Assertions): A precusor to this library. Written in the older test case / assert style.
@@ -3,8 +3,7 @@ require 'rspec/webservice_matchers/util'
3
3
  module RSpec
4
4
  module WebserviceMatchers
5
5
  module BeUp
6
- # Pass when the response code is 200, following redirects
7
- # if necessary.
6
+ # Pass when the response code is 200, following redirects if necessary.
8
7
  RSpec::Matchers.define :be_up do
9
8
  status = nil
10
9
 
@@ -7,13 +7,14 @@ module RSpec
7
7
  return Util.error_message(exception) if exception
8
8
 
9
9
  errors = []
10
- unless redirect? status, kind: kind
11
- errors << "received a #{kind_for(status)} redirect"
12
- end
13
- unless locations_match? expected, actual_location
14
- errors << "received location #{actual_location}"
15
- end
16
- unless redirect? status
10
+ if redirect? status
11
+ unless redirect? status, kind: kind
12
+ errors << "received a #{kind_for(status)} redirect"
13
+ end
14
+ unless locations_match? expected, actual_location
15
+ errors << "received location #{actual_location}"
16
+ end
17
+ else
17
18
  errors << "not a redirect: received status #{status}"
18
19
  end
19
20
 
@@ -1,5 +1,5 @@
1
1
  module RSpec
2
2
  module WebserviceMatchers
3
- VERSION = '4.1.1'
3
+ VERSION = '4.1.2'
4
4
  end
5
5
  end
@@ -51,7 +51,7 @@ describe 'be_up' do
51
51
  it 'gives relevant error output' do
52
52
  expect {
53
53
  expect('http://notfound.com/no.txt').to be_up
54
- }.to fail_matching(/404/)
54
+ }.to fail_matching(/^received status 404$/i)
55
55
  end
56
56
 
57
57
  it 'succeeds even if the site times out on the first try' do
@@ -29,7 +29,7 @@ describe 'redirect_permanently_to' do
29
29
  it 'gives a good error message for a non-redirect status' do
30
30
  expect {
31
31
  expect('notfound.com').to redirect_permanently_to 'http://the-wrong-site.com/'
32
- }.to fail_matching(/404/i)
32
+ }.to fail_matching(/^not a redirect: received status 404$/i)
33
33
  end
34
34
 
35
35
  it 'gives a good error message when the hostname is bad' do
@@ -67,7 +67,7 @@ describe 'redirect_temporarily_to' do
67
67
  it 'gives a good error message for a non-redirect status' do
68
68
  expect {
69
69
  expect('notfound.com').to redirect_temporarily_to 'www.nowhere.com'
70
- }.to fail_matching(/404/i)
70
+ }.to fail_matching(/^not a redirect: received status 404$/i)
71
71
  end
72
72
 
73
73
  it 'gives a good error message when the hostname is bad' do
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.1
4
+ version: 4.1.2
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-29 00:00:00.000000000 Z
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
171
171
  version: '0'
172
172
  requirements: []
173
173
  rubyforge_project:
174
- rubygems_version: 2.5.0
174
+ rubygems_version: 2.5.1
175
175
  signing_key:
176
176
  specification_version: 4
177
177
  summary: Black-box web app configuration testing
@@ -181,4 +181,3 @@ test_files:
181
181
  - spec/rspec/webservice_matchers/redirect_spec.rb
182
182
  - spec/rspec/webservice_matchers/ssl_spec.rb
183
183
  - spec/spec_helper.rb
184
- has_rdoc: