voxpupuli-acceptance 3.2.0 → 3.4.0

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
  SHA256:
3
- metadata.gz: 4db92d14b0560b44ea68797759d8d4f6cae2739ebf9972f5323eabc2a2e777c6
4
- data.tar.gz: 8d9d86d6529f94086c29c4bc29ab8e2d0374501c6dc243576f047ee3fb67d54a
3
+ metadata.gz: 0ed2d3f327132608845f5b0553c0759b2852a9b9a9f08058489c2ee1ce193a14
4
+ data.tar.gz: f13c02206e5b728161840a71e48b9ab06227338b27bfa146502808a198421266
5
5
  SHA512:
6
- metadata.gz: 1fd5146ce4b65ece50c965d0bdb061d2149efcb77cf33307c164ddbffd4007c467b4b2ebcc653fc9f1d89821bf6306e73a097124ed606eea0b4802e895731a9c
7
- data.tar.gz: ff8eb14bc5d2a8422cb6d89622287f70da71f8be03b6b2e379a7ba14c99ce7b448bcd4c270a715afdd64bc7e3618817c7af2a851efef586153365766ed9e36e0
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
@@ -0,0 +1,12 @@
1
+ require 'serverspec'
2
+ require_relative 'serverspec_extensions/curl_command'
3
+
4
+ module Serverspec
5
+ module Helper
6
+ module Type
7
+ def curl_command(*args)
8
+ Voxpupuli::Acceptance::ServerspecExtensions::CurlCommand.new(*args)
9
+ end
10
+ end
11
+ end
12
+ end
@@ -1,4 +1,5 @@
1
1
  require_relative 'examples'
2
+ require_relative 'serverspec_extensions'
2
3
 
3
4
  def configure_beaker(modules: :metadata, &block)
4
5
  collection = ENV['BEAKER_PUPPET_COLLECTION'] || 'puppet'
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.2.0
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: 2024-05-29 00:00:00.000000000 Z
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: '1.0'
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: '1.0'
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: '8'
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: '8'
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.9
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: []