mirror of
https://github.com/inspec/inspec
synced 2024-12-30 06:53:22 +00:00
18ce4850f0
This should get windows tests running again? Hopefully? They're running SO slowly on my vagrant box that I'm just pushing for now. They're clean on the mac side. Signed-off-by: Ryan Davis <zenspider@chef.io>
40 lines
1 KiB
Ruby
40 lines
1 KiB
Ruby
require_relative "../../../shared/core_plugin_test_helper.rb"
|
|
require "fileutils"
|
|
|
|
class ProfileCli < Minitest::Test
|
|
include CorePluginFunctionalHelper
|
|
|
|
def setup
|
|
skip_windows!
|
|
@tmpdir = Dir.mktmpdir
|
|
@habitat_profile = File.join(@tmpdir, "habitat-profile")
|
|
run_inspec_process("init profile " + @habitat_profile)
|
|
end
|
|
|
|
def teardown
|
|
FileUtils.remove_entry_secure(@tmpdir)
|
|
end
|
|
|
|
def test_setup_subcommand
|
|
result = run_inspec_process("habitat profile setup " + @habitat_profile + " --log-level debug")
|
|
|
|
# Command creates only expected files
|
|
base_dir = File.join(@tmpdir, "habitat-profile", "habitat")
|
|
files = %w{
|
|
default.toml
|
|
plan.sh
|
|
config
|
|
config/inspec_exec_config.json
|
|
hooks
|
|
hooks/run
|
|
}
|
|
actual_files = Dir.glob(File.join(base_dir, "**/*"))
|
|
expected_files = files.map { |x| File.join(base_dir, x) }
|
|
assert_equal actual_files.sort, expected_files.sort
|
|
|
|
# Command runs without error
|
|
assert_empty result.stderr
|
|
|
|
assert_exit_code 0, result
|
|
end
|
|
end
|