Class: ProfileCli
- Inherits:
-
Minitest::Test
- Object
- Minitest::Test
- ProfileCli
show all
- Includes:
- CorePluginFunctionalHelper
- Defined in:
- lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb
Constant Summary
CorePluginFunctionalHelper::TRAIN_CONNECTION
Instance Method Summary
collapse
#__find_plugin_path_from_caller, #__make_empty_plugin_file_data_structure, #__make_plugin_file_data_structure_with_path, #run_inspec_process, #run_inspec_process_with_this_plugin
Instance Method Details
#setup ⇒ Object
7
8
9
10
11
12
|
# File 'lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb', line 7
def setup
skip_windows!
@tmpdir = Dir.mktmpdir
@habitat_profile = File.join(@tmpdir, "habitat-profile")
run_inspec_process("init profile " + @habitat_profile)
end
|
#teardown ⇒ Object
14
15
16
|
# File 'lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb', line 14
def teardown
FileUtils.remove_entry_secure(@tmpdir)
end
|
#test_setup_subcommand ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
# File 'lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb', line 18
def test_setup_subcommand
result = run_inspec_process("habitat profile setup " + @habitat_profile + " --log-level debug")
assert_empty result.stderr
assert_equal 0, result.exit_status
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
end
|