lib/kitchen/verifier/pester.rb in kitchen-pester-0.10.0 vs lib/kitchen/verifier/pester.rb in kitchen-pester-0.11.0
- old
+ new
@@ -16,10 +16,11 @@
# See the License for the specific language governing permissions and
# limitations under the License.
require "pathname"
require "kitchen/verifier/base"
+require "kitchen/version"
require_relative "pester_version"
module Kitchen
module Verifier
@@ -126,10 +127,12 @@
$TestPath = "#{config[:root_path]}"
$OutputFilePath = $TestPath | Join-Path -ChildPath 'PesterTestResults.xml'
$result = Invoke-Pester -OutputFile $OutputFilePath -OutputFormat NUnitXml -Path $TestPath -Passthru
$result | Export-CliXml -Path (Join-Path -Path $TestPath -ChildPath 'result.xml')
- $host.SetShouldExit($result.FailedCount)
+ $LASTEXITCODE = $result.FailedCount
+ $host.SetShouldExit($LASTEXITCODE)
+ exit $LASTEXITCODE
CMD
end
def really_wrap_shell_code(code)
wrap_shell_code(Util.outdent!(use_local_powershell_modules(code)))