prodder-steps 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -1
- data/lib/prodder-steps/headers.rb +10 -2
- data/lib/prodder-steps/version.rb +1 -1
- metadata +3 -3
data/README.md
CHANGED
@@ -4,6 +4,10 @@ def canonical_header(header)
|
|
4
4
|
header.downcase.gsub('-', '_').to_sym
|
5
5
|
end
|
6
6
|
|
7
|
+
def header_includes_attribute?(header, attribute)
|
8
|
+
@response.headers[canonical_header(header)].to_s.should =~ /#{attribute}/
|
9
|
+
end
|
10
|
+
|
7
11
|
When(/^we request the site over "(.*?)"$/) do |protocol|
|
8
12
|
@response = RestClient.get "#{protocol.downcase}://#{ENV['HOST']}"
|
9
13
|
end
|
@@ -20,6 +24,10 @@ Then(/^the "(.*?)" header should be set$/) do |header|
|
|
20
24
|
@response.headers.should have_key(canonical_header(header))
|
21
25
|
end
|
22
26
|
|
23
|
-
Then(/^the "(.*?)" header should have the "(.*?)" attribute$/) do |header, attribute|
|
24
|
-
|
27
|
+
Then(/^(if present, )?the "(.*?)" header should have the "(.*?)" attribute$/) do |optional, header, attribute|
|
28
|
+
if optional
|
29
|
+
header_includes_attribute?(header, attribute) if @response.headers[canonical_header(header)]
|
30
|
+
else
|
31
|
+
header_includes_attribute?(header, attribute)
|
32
|
+
end
|
25
33
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prodder-steps
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -142,7 +142,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
142
142
|
version: '0'
|
143
143
|
segments:
|
144
144
|
- 0
|
145
|
-
hash:
|
145
|
+
hash: 284679941429222512
|
146
146
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
147
147
|
none: false
|
148
148
|
requirements:
|
@@ -151,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
151
|
version: '0'
|
152
152
|
segments:
|
153
153
|
- 0
|
154
|
-
hash:
|
154
|
+
hash: 284679941429222512
|
155
155
|
requirements: []
|
156
156
|
rubyforge_project:
|
157
157
|
rubygems_version: 1.8.24
|