voxpupuli-acceptance 3.2.0 → 3.4.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0ed2d3f327132608845f5b0553c0759b2852a9b9a9f08058489c2ee1ce193a14
|
4
|
+
data.tar.gz: f13c02206e5b728161840a71e48b9ab06227338b27bfa146502808a198421266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c29e23b6893631c7a4e08cca6096bf5e810a0998c2be2931cfdbb3ea5e28a3dcc66bdad50af311f73840bb286969906e594ad210d615f714578cc4efe1e55739
|
7
|
+
data.tar.gz: 7bcc52d34f2261362dbdeec11227265ed2a5a1d1935533db9f58ebc26142f7366218368f2596ad359f7f88d28396cc76b159c2a6fc4cee60773c393218db5383
|
@@ -0,0 +1,58 @@
|
|
1
|
+
# written by https://github.com/ekohl
|
2
|
+
# https://github.com/mizzy/serverspec/pull/611 was rejected so adding it here.
|
3
|
+
|
4
|
+
require 'serverspec'
|
5
|
+
|
6
|
+
module Voxpupuli
|
7
|
+
module Acceptance
|
8
|
+
module ServerspecExtensions
|
9
|
+
class CurlCommand < Serverspec::Type::Command
|
10
|
+
def response_code
|
11
|
+
m = %r{Response-Code: (?<code>\d+)}.match(stderr)
|
12
|
+
return 0 unless m
|
13
|
+
|
14
|
+
m[:code].to_i
|
15
|
+
end
|
16
|
+
|
17
|
+
def body
|
18
|
+
command_result.stdout
|
19
|
+
end
|
20
|
+
|
21
|
+
def body_as_json
|
22
|
+
MultiJson.load(body)
|
23
|
+
end
|
24
|
+
|
25
|
+
private
|
26
|
+
|
27
|
+
def curl_command
|
28
|
+
# curl supports %{stderr} to --write-out since 7.63.0
|
29
|
+
# so the following doesn't work on EL8, which has curl 7.61.1
|
30
|
+
command = "curl --silent --write-out '%{stderr}Response-Code: %{response_code}\\n' '#{@name}'"
|
31
|
+
|
32
|
+
@options.each do |option, value|
|
33
|
+
case option
|
34
|
+
when :cacert, :cert, :key
|
35
|
+
command += " --#{option} '#{value}'"
|
36
|
+
when :headers
|
37
|
+
value.each do |header, header_value|
|
38
|
+
command += if header_value
|
39
|
+
" --header '#{header}: #{header_value}'"
|
40
|
+
else
|
41
|
+
" --header '#{header};'"
|
42
|
+
end
|
43
|
+
end
|
44
|
+
else
|
45
|
+
raise "Unknown option #{option} (value: #{value})"
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
command
|
50
|
+
end
|
51
|
+
|
52
|
+
def command_result
|
53
|
+
@command_result ||= @runner.run_command(curl_command)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: voxpupuli-acceptance
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vox Pupuli
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bcrypt_pbkdf
|
@@ -134,14 +134,20 @@ dependencies:
|
|
134
134
|
requirements:
|
135
135
|
- - "~>"
|
136
136
|
- !ruby/object:Gem::Version
|
137
|
-
version: '
|
137
|
+
version: '2.0'
|
138
|
+
- - ">="
|
139
|
+
- !ruby/object:Gem::Version
|
140
|
+
version: 2.0.2
|
138
141
|
type: :runtime
|
139
142
|
prerelease: false
|
140
143
|
version_requirements: !ruby/object:Gem::Requirement
|
141
144
|
requirements:
|
142
145
|
- - "~>"
|
143
146
|
- !ruby/object:Gem::Version
|
144
|
-
version: '
|
147
|
+
version: '2.0'
|
148
|
+
- - ">="
|
149
|
+
- !ruby/object:Gem::Version
|
150
|
+
version: 2.0.2
|
145
151
|
- !ruby/object:Gem::Dependency
|
146
152
|
name: rake
|
147
153
|
requirement: !ruby/object:Gem::Requirement
|
@@ -225,7 +231,7 @@ dependencies:
|
|
225
231
|
version: 4.0.0
|
226
232
|
- - "<"
|
227
233
|
- !ruby/object:Gem::Version
|
228
|
-
version: '
|
234
|
+
version: '9'
|
229
235
|
type: :development
|
230
236
|
prerelease: false
|
231
237
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -235,7 +241,7 @@ dependencies:
|
|
235
241
|
version: 4.0.0
|
236
242
|
- - "<"
|
237
243
|
- !ruby/object:Gem::Version
|
238
|
-
version: '
|
244
|
+
version: '9'
|
239
245
|
description: A package that depends on all the gems Vox Pupuli modules need and methods
|
240
246
|
to simplify acceptance spec helpers
|
241
247
|
email:
|
@@ -249,12 +255,14 @@ files:
|
|
249
255
|
- lib/voxpupuli/acceptance/facts.rb
|
250
256
|
- lib/voxpupuli/acceptance/fixtures.rb
|
251
257
|
- lib/voxpupuli/acceptance/rake.rb
|
258
|
+
- lib/voxpupuli/acceptance/serverspec_extensions.rb
|
259
|
+
- lib/voxpupuli/acceptance/serverspec_extensions/curl_command.rb
|
252
260
|
- lib/voxpupuli/acceptance/spec_helper_acceptance.rb
|
253
261
|
homepage: https://github.com/voxpupuli/voxpupuli-acceptance
|
254
262
|
licenses:
|
255
263
|
- Apache-2.0
|
256
264
|
metadata: {}
|
257
|
-
post_install_message:
|
265
|
+
post_install_message:
|
258
266
|
rdoc_options: []
|
259
267
|
require_paths:
|
260
268
|
- lib
|
@@ -272,8 +280,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
280
|
- !ruby/object:Gem::Version
|
273
281
|
version: '0'
|
274
282
|
requirements: []
|
275
|
-
rubygems_version: 3.5.
|
276
|
-
signing_key:
|
283
|
+
rubygems_version: 3.5.22
|
284
|
+
signing_key:
|
277
285
|
specification_version: 4
|
278
286
|
summary: Helpers for acceptance testing Vox Pupuli modules
|
279
287
|
test_files: []
|