akamai_rspec 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/akamai_rspec/matchers/matchers.rb +13 -7
- 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: 95accf56ecbd5da4dea5c91a38288a6f216607d0
|
4
|
+
data.tar.gz: 3491425883955d90f7a0f8122cdfbbcfba5042d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d70621b82a1a6bbb246918c824cfb99f06236ad69c5f2f36e112cd7b46be53ecc99807157b94a449956524f4213321d1657b253fae52707c7b0282036ccc137
|
7
|
+
data.tar.gz: 4ef55828e09f523a8bfe1e9eabeba551be6f9d5aefa317e48406819f7c24aeb596b679aa9c48415fdf45bc32a93a2801670d6cf098c89d89e4d29f6362d473e5
|
@@ -6,20 +6,26 @@ require_relative 'non_akamai'
|
|
6
6
|
require_relative 'honour_origin_headers'
|
7
7
|
include AkamaiHeaders
|
8
8
|
|
9
|
-
RSpec::Matchers.define :
|
9
|
+
RSpec::Matchers.define :be_served_from_origin do |contents|
|
10
10
|
match do |url|
|
11
11
|
response = RestClient::Request.responsify url
|
12
12
|
fail 'No X-Cache-Key header' if response.headers[:x_cache_key].nil?
|
13
|
-
unless response.headers[:x_cache_key]
|
14
|
-
fail("x_cache_key has value '#{response.headers[:x_cache_key]}' which doesn't
|
13
|
+
unless response.headers[:x_cache_key] =~ /\/#{contents}\//
|
14
|
+
fail("x_cache_key has value '#{response.headers[:x_cache_key]}' which doesn't match '#{contents}'")
|
15
15
|
end
|
16
|
-
response.code == 200
|
16
|
+
response.code == 200
|
17
17
|
end
|
18
18
|
end
|
19
19
|
|
20
|
-
|
21
|
-
|
22
|
-
|
20
|
+
RSpec::Matchers.define :have_cp_code do |contents|
|
21
|
+
match do |url|
|
22
|
+
response = RestClient::Request.responsify url
|
23
|
+
fail 'No X-Cache-Key header' if response.headers[:x_cache_key].nil?
|
24
|
+
unless response.headers[:x_cache_key].include?(contents)
|
25
|
+
fail("x_cache_key has value '#{response.headers[:x_cache_key]}' which doesn't include '#{contents}'")
|
26
|
+
end
|
27
|
+
response.code == 200
|
28
|
+
end
|
23
29
|
end
|
24
30
|
|
25
31
|
RSpec::Matchers.define :be_forwarded_to_index do |channel|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: akamai_rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bianca Gibson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
@@ -52,7 +52,7 @@ dependencies:
|
|
52
52
|
- - ~>
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.2'
|
55
|
-
description:
|
55
|
+
description: Test your akamai configuration with rspec
|
56
56
|
email: bianca.gibson@rea-group.com
|
57
57
|
executables: []
|
58
58
|
extensions: []
|