kitchen-pester 1.1.1 → 1.2.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: e31dac41f9925e0fb86d2b96a2ead03a1c1dabb42adbf038ef572966aeb6d7db
4
- data.tar.gz: 9047b382ad4d31572b7515aeb70d495e54019a87207cad463598938a669c38f7
3
+ metadata.gz: 19d804e92d719bc9b7a474f32fb09562e5ca26e56a7d22f2ce432a5b704fd59f
4
+ data.tar.gz: 85891cc61ec3764ba9d9397958f8610f3a3e9238d53c6b6f9fdc26814ada51b2
5
5
  SHA512:
6
- metadata.gz: 73bcc2e6ba82f652ca7ffd81d27c05b96d3eb1e0101043b0207d7dd583b8c040979f23a37f1b6c59c719979e026ce2df3ff7f8c319cb1dd41783668d3f0cd3e0
7
- data.tar.gz: 7b63adcc2817a530bc5ddc8a2feb159353f80217abd739c8aba2019a222c6a841911c0a543dd8cb2fdf4159a3de9ae16aa3426333d71a4dd8175bb52dc0f9d80
6
+ metadata.gz: 7da614b278d3fc0f408dc0d913ba9c853bf3997ef669aba45578bb23d65c725bcefcaffb75b8d799f579fca233ae7f84134983cb6147b7bcd91c51041c0dbb2b
7
+ data.tar.gz: 56af02995deb34e6a6044396096ada3b4fbe371b9d8c2be1a74dbf8109728808110d28e9a9e620951530bc48e5b2ac3bbf49ba07046630f393c67c8d2b83a766
@@ -16,9 +16,8 @@ Gem::Specification.new do |spec|
16
16
  spec.files = %w{LICENSE kitchen-pester.gemspec Gemfile Rakefile} + Dir.glob("lib/**/*")
17
17
  spec.require_paths = ["lib"]
18
18
 
19
- spec.add_development_dependency "bundler"
20
19
  spec.add_development_dependency "rake"
21
- spec.add_development_dependency "minitest", "~> 5.3", "< 5.15"
20
+ spec.add_development_dependency "minitest", "~> 5.3", "< 5.16"
22
21
  spec.add_development_dependency "mocha", "~> 1.1"
23
22
 
24
23
  spec.add_dependency "test-kitchen", ">= 1.10", "< 4"
@@ -66,6 +66,7 @@ module Kitchen
66
66
  default_config :copy_folders, []
67
67
  default_config :sudo, false
68
68
  default_config :shell, nil
69
+ default_config :environment, {}
69
70
 
70
71
  # Creates a new Verifier object using the provided configuration data
71
72
  # which will be merged with any default configuration.
@@ -73,6 +74,7 @@ module Kitchen
73
74
  # @param config [Hash] provided verifier configuration
74
75
  def initialize(config = {})
75
76
  init_config(config)
77
+ raise ClientError.new "Environment Variables must be specified as a hash, not a #{config[:environment].class}" unless config[:environment].is_a?(Hash)
76
78
  end
77
79
 
78
80
  # Creates a temporary directory on the local workstation into which
@@ -188,6 +190,7 @@ module Kitchen
188
190
  config[:downloads] = config[:downloads]
189
191
  .map do |source, destination|
190
192
  source = source.to_s
193
+ destination = destination.gsub("%{instance_name}", instance.name)
191
194
  info(" resolving remote source's absolute path.")
192
195
  unless source.match?('^/|^[a-zA-Z]:[\\/]') # is Absolute?
193
196
  info(" '#{source}' is a relative path, resolving to: #{File.join(config[:root_path], source)}")
@@ -201,7 +204,7 @@ module Kitchen
201
204
  if !File.directory?(File.dirname(destination))
202
205
  FileUtils.mkdir_p(File.dirname(destination))
203
206
  else
204
- info(" Directory #{File.dirname(destination)} seem to exist.")
207
+ info(" Directory #{File.dirname(destination)} seems to exist.")
205
208
  end
206
209
 
207
210
  [ source, destination ]
@@ -240,6 +243,7 @@ module Kitchen
240
243
  $TestPath = Join-Path "#{config[:root_path]}" -ChildPath "suites"
241
244
  $OutputFilePath = Join-Path "#{config[:root_path]}" -ChildPath 'PesterTestResults.xml'
242
245
 
246
+ #{ps_environment(config[:environment])}
243
247
  if ($PesterModule.Version.Major -le 4)
244
248
  {
245
249
  Write-Host -Object "Invoke Pester with v$($PesterModule.Version) Options"
@@ -435,7 +439,9 @@ module Kitchen
435
439
  # Send the pwsh here string to the file kitchen_cmd.ps1
436
440
  @'
437
441
  try {
438
- Set-ExecutionPolicy Unrestricted -force
442
+ if (@('Bypass', 'Unrestricted') -notcontains (Get-ExecutionPolicy)) {
443
+ Set-ExecutionPolicy Unrestricted -Force -Scope Process
444
+ }
439
445
  }
440
446
  catch {
441
447
  $_ | Out-String | Write-Warning
@@ -615,6 +621,17 @@ module Kitchen
615
621
  end
616
622
  end
617
623
 
624
+ # Creates environment variable assignments from a ruby map.
625
+ #
626
+ # @api private
627
+ def ps_environment(obj)
628
+ commands = obj.map do |k, v|
629
+ "$env:#{k} = '#{v}'"
630
+ end
631
+
632
+ commands.join("\n")
633
+ end
634
+
618
635
  # returns the path of the modules subfolder
619
636
  # in the sandbox, where PS Modules and folders will be copied to.
620
637
  #
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Verifier
3
- PESTER_VERSION = "1.1.1".freeze
3
+ PESTER_VERSION = "1.2.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,29 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-pester
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-16 00:00:00.000000000 Z
11
+ date: 2022-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
13
  - !ruby/object:Gem::Dependency
28
14
  name: rake
29
15
  requirement: !ruby/object:Gem::Requirement
@@ -47,7 +33,7 @@ dependencies:
47
33
  version: '5.3'
48
34
  - - "<"
49
35
  - !ruby/object:Gem::Version
50
- version: '5.15'
36
+ version: '5.16'
51
37
  type: :development
52
38
  prerelease: false
53
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -57,7 +43,7 @@ dependencies:
57
43
  version: '5.3'
58
44
  - - "<"
59
45
  - !ruby/object:Gem::Version
60
- version: '5.15'
46
+ version: '5.16'
61
47
  - !ruby/object:Gem::Dependency
62
48
  name: mocha
63
49
  requirement: !ruby/object:Gem::Requirement
@@ -110,7 +96,7 @@ homepage: https://github.com/test-kitchen/kitchen-pester
110
96
  licenses:
111
97
  - Apache-2.0
112
98
  metadata: {}
113
- post_install_message:
99
+ post_install_message:
114
100
  rdoc_options: []
115
101
  require_paths:
116
102
  - lib
@@ -125,8 +111,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
111
  - !ruby/object:Gem::Version
126
112
  version: '0'
127
113
  requirements: []
128
- rubygems_version: 3.0.6
129
- signing_key:
114
+ rubygems_version: 3.0.3.1
115
+ signing_key:
130
116
  specification_version: 4
131
117
  summary: Test-Kitchen verifier for Pester.
132
118
  test_files: []