Merge pull request #4159 from inspec/zenspider/windows_fixes

Windows fixes
This commit is contained in:
Miah Johnson 2019-05-29 18:08:18 -07:00 committed by GitHub
commit 6898319086
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -6,6 +6,8 @@ require 'fileutils'
require 'yaml' require 'yaml'
require 'tmpdir' require 'tmpdir'
ENV["CHEF_LICENSE"] = "accept-no-persist"
require 'minitest/hell' require 'minitest/hell'
class Minitest::Test class Minitest::Test
parallelize_me! parallelize_me!
@ -125,7 +127,7 @@ module FunctionalHelper
def inspec(commandline, prefix = nil) def inspec(commandline, prefix = nil)
if is_windows? if is_windows?
invocation = "cmd /C \"#{prefix} bundle exec ruby #{exec_inspec} #{commandline}\"" invocation = "powershell -NonInteractive -Command \"#{prefix} bundle exec #{exec_inspec} #{commandline}\""
result = CMD.run_command(invocation) result = CMD.run_command(invocation)
result.stdout.encode!(universal_newline: true) result.stdout.encode!(universal_newline: true)
result.stderr.encode!(universal_newline: true) result.stderr.encode!(universal_newline: true)

View file

@ -1,3 +1,5 @@
Encoding.default_external = Encoding::UTF_8
require 'minitest/autorun' require 'minitest/autorun'
require 'inspec/ui' require 'inspec/ui'
require 'inspec/base_cli' require 'inspec/base_cli'