kitchen-pester 0.12.0 → 0.12.1

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: 035e3a6cc233184cbefdf808a6712b7fc538d89cb4bc6613e66e073514e54280
4
- data.tar.gz: 5981514b90ce8c1ecf2f81e213f22eacd5cb88acf986b66266cadcd47f40809e
3
+ metadata.gz: da53197e406192ac305bcdc54725ecd52787ee9b9bccff32e8438f7bd8f31796
4
+ data.tar.gz: 0c28027331124a37ce8dd730598b191a26f3e69df8b4240921eead3f289e7c52
5
5
  SHA512:
6
- metadata.gz: 3ad622c48d073d4f8ea62badd283dc87bc2f9d81277089a2a5078e6c00c9b9f0f8aacebbfa1e4436e8ef0d2f3e815aac3fc6b333946e5a1f5df875a7de8d9d62
7
- data.tar.gz: c232cfd8ba4e99c94be84b6af8e3328c15d080cb6691237ff40760c8cbc2a1703dc86ec831828340a412cef38c0ffedf366cd2f6dbee4d8c514d3e5a8f8713a8
6
+ metadata.gz: bff325f80a68eb821aecd0d761c29e4caa5c6cb9bd2f738f13219d3c9c8496ee73d34b2dbaa6e41c44392971f85fce6387765a1c4c81a6e41a7801c42e2987ee
7
+ data.tar.gz: d1ad67092b11dc19c7d455a1b51c62a55d1aeb5aaed613526005f2f264710d8504de18a96b56fb27646304001f5cc661e9b8945d909c79a71b3f212275bd4f1a
data/Gemfile CHANGED
@@ -16,7 +16,7 @@ end
16
16
 
17
17
  group :debug do
18
18
  gem "pry", "~>0.13.1"
19
- gem "pry-byebug", "~>3.8.0"
19
+ gem "pry-byebug", "~>3.9.0"
20
20
  gem "pry-stack_explorer"
21
21
  end
22
22
 
@@ -115,8 +115,19 @@ module Kitchen
115
115
  if Gem::Version.new(Kitchen::VERSION) <= Gem::Version.new("2.3.4")
116
116
  def call(state)
117
117
  super
118
-
118
+ ensure
119
+ download_test_files(state)
120
+ end
121
+ else
122
+ def call(state)
123
+ super
124
+ rescue
125
+ # If the verifier reports failure, we need to download the files ourselves.
126
+ # Test Kitchen's base verifier doesn't have the download in an `ensure` block.
119
127
  download_test_files(state)
128
+
129
+ # Rethrow original exception, we still want to register the failure.
130
+ raise
120
131
  end
121
132
  end
122
133
 
@@ -130,7 +141,7 @@ module Kitchen
130
141
 
131
142
  $options = New-PesterOption -TestSuiteName "Pester - #{instance.to_str}"
132
143
 
133
- $result = Invoke-Pester -Script $TestPath -OutputFile $OutputFilePath -OutputFormat NUnitXml -PesterOption $option -PassThru
144
+ $result = Invoke-Pester -Script $TestPath -OutputFile $OutputFilePath -OutputFormat NUnitXml -PesterOption $options -PassThru
134
145
  $result | Export-CliXml -Path (Join-Path -Path $TestPath -ChildPath 'result.xml')
135
146
 
136
147
  $LASTEXITCODE = $result.FailedCount
@@ -225,11 +236,19 @@ module Kitchen
225
236
  Import-Module -Name PsGet -Force -ErrorAction Stop
226
237
  }
227
238
 
228
- Install-Module -Name Pester
239
+ Install-Module -Name Pester -Force
229
240
  }
230
241
  catch {
231
242
  Write-Host "Installing from Github"
232
- $zipfile = Join-Path (Get-Item -Path "$env:TEMP/module").FullName -ChildPath "pester.zip"
243
+
244
+ $downloadFolder = if (Test-Path "$env:TEMP/PesterDownload") {
245
+ "$env:TEMP/PesterDownload"
246
+ }
247
+ else {
248
+ New-Item -ItemType Directory -Path "$env:TEMP/PesterDownload"
249
+ }
250
+
251
+ $zipFile = Join-Path (Get-Item -Path $downloadFolder).FullName -ChildPath "pester.zip"
233
252
 
234
253
  if (-not (Test-Path $zipfile)) {
235
254
  $source = 'https://github.com/pester/Pester/archive/4.10.1.zip'
@@ -294,14 +313,7 @@ module Kitchen
294
313
  instance.transport.connection(state) do |conn|
295
314
  config[:downloads].to_h.each do |remotes, local|
296
315
  debug("Downloading #{Array(remotes).join(", ")} to #{local}")
297
-
298
- Array(remotes).each do |file|
299
- safe_name = instance.name.gsub(/[^0-9A-Z-]/i, "_")
300
- local_path = File.join(local, safe_name, file)
301
- remote_path = File.join(config[:root_path], file)
302
-
303
- conn.download(remote_path, local_path)
304
- end
316
+ conn.download(remotes, local)
305
317
  end
306
318
  end
307
319
 
@@ -1,5 +1,5 @@
1
1
  module Kitchen
2
2
  module Verifier
3
- PESTER_VERSION = "0.12.0".freeze
3
+ PESTER_VERSION = "0.12.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-pester
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Murawski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-05 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -125,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
125
125
  - !ruby/object:Gem::Version
126
126
  version: '0'
127
127
  requirements: []
128
- rubygems_version: 3.0.3
128
+ rubygems_version: 3.0.6
129
129
  signing_key:
130
130
  specification_version: 4
131
131
  summary: Test-Kitchen verifier for Pester.