inspec-core 3.7.11 → 3.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/inspec/reporters/automate.rb +0 -4
- data/lib/inspec/reporters/json_automate.rb +7 -1
- data/lib/inspec/version.rb +1 -1
- metadata +2 -39
- data/lib/plugins/inspec-artifact/test/functional/inspec_artifact_test.rb +0 -46
- data/lib/plugins/inspec-compliance/test/functional/inspec_compliance_test.rb +0 -43
- data/lib/plugins/inspec-compliance/test/integration/default/cli.rb +0 -93
- data/lib/plugins/inspec-compliance/test/unit/api/login_test.rb +0 -190
- data/lib/plugins/inspec-compliance/test/unit/api_test.rb +0 -385
- data/lib/plugins/inspec-compliance/test/unit/target_test.rb +0 -155
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/Berksfile +0 -2
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/files/hab_setup.exp +0 -28
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/metadata.rb +0 -9
- data/lib/plugins/inspec-habitat/test/cookbooks/inspec_habitat_fixture/recipes/default.rb +0 -61
- data/lib/plugins/inspec-habitat/test/functional/inspec_habitat_test.rb +0 -38
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/controls/inspec_habitat.rb +0 -40
- data/lib/plugins/inspec-habitat/test/integration/default/inspec_habitat/inspec.yml +0 -10
- data/lib/plugins/inspec-habitat/test/support/example_profile/README.md +0 -3
- data/lib/plugins/inspec-habitat/test/support/example_profile/controls/example.rb +0 -7
- data/lib/plugins/inspec-habitat/test/support/example_profile/inspec.yml +0 -10
- data/lib/plugins/inspec-habitat/test/unit/profile_test.rb +0 -240
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/fixtures/README.md +0 -24
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/README.md +0 -12
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/functional/inspec_plugin_template_test.rb +0 -110
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/helper.rb +0 -26
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/README.md +0 -17
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/cli_args_test.rb +0 -67
- data/lib/plugins/inspec-init/templates/plugins/inspec-plugin-template/test/unit/plugin_def_test.rb +0 -51
- data/lib/plugins/inspec-init/test/functional/inspec_init_plugin_test.rb +0 -173
- data/lib/plugins/inspec-init/test/functional/inspec_init_profile_test.rb +0 -100
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/config_dirs/empty/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette.rb +0 -2
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-egg-white-omelette/lib/inspec-egg-white-omelette/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/inspec-wrong-structure/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name.rb +0 -1
- data/lib/plugins/inspec-plugin-manager-cli/test/fixtures/plugins/wrong-name/lib/wrong-name/.gitkeep +0 -0
- data/lib/plugins/inspec-plugin-manager-cli/test/functional/inspec-plugin_test.rb +0 -713
- data/lib/plugins/inspec-plugin-manager-cli/test/unit/cli_args_test.rb +0 -75
- data/lib/plugins/inspec-plugin-manager-cli/test/unit/plugin_def_test.rb +0 -20
@@ -1,75 +0,0 @@
|
|
1
|
-
require_relative '../../../shared/core_plugin_test_helper.rb'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------#
|
4
|
-
# Thor option defs
|
5
|
-
#-----------------------------------------------------------------------#
|
6
|
-
class PluginManagerCliOptions < MiniTest::Test
|
7
|
-
include CorePluginUnitHelper
|
8
|
-
let(:cli_class) { InspecPlugins::PluginManager::CliCommand }
|
9
|
-
|
10
|
-
def setup
|
11
|
-
require_relative '../../lib/inspec-plugin-manager-cli/cli_command'
|
12
|
-
end
|
13
|
-
|
14
|
-
def test_list_args
|
15
|
-
arg_config = cli_class.all_commands['list'].options
|
16
|
-
assert_equal 1, arg_config.count, 'The list command should have 1 option'
|
17
|
-
|
18
|
-
assert_includes arg_config.keys, :all, 'The list command should have an --all option'
|
19
|
-
assert_equal :boolean, arg_config[:all].type, 'The --all option should be boolean'
|
20
|
-
assert_equal :a, arg_config[:all].aliases.first, 'The --all option should be aliased as -a'
|
21
|
-
refute_nil arg_config[:all].description, 'The --all option should have a description'
|
22
|
-
refute arg_config[:all].required, 'The --all option should not be required'
|
23
|
-
|
24
|
-
assert_equal 0, cli_class.instance_method(:list).arity, 'The list command should take no arguments'
|
25
|
-
end
|
26
|
-
|
27
|
-
def test_search_args
|
28
|
-
arg_config = cli_class.all_commands['search'].options
|
29
|
-
assert_equal 3, arg_config.count, 'The search command should have 3 options'
|
30
|
-
|
31
|
-
assert_includes arg_config.keys, :all, 'The search command should have an --all option'
|
32
|
-
assert_equal :boolean, arg_config[:all].type, 'The --all option should be boolean'
|
33
|
-
assert_equal :a, arg_config[:all].aliases.first, 'The --all option should be aliased as -a'
|
34
|
-
refute_nil arg_config[:all].description, 'The --all option should have a description'
|
35
|
-
refute arg_config[:all].required, 'The --all option should not be required'
|
36
|
-
|
37
|
-
assert_includes arg_config.keys, :exact, 'The search command should have an --exact option'
|
38
|
-
assert_equal :boolean, arg_config[:exact].type, 'The --exact option should be boolean'
|
39
|
-
assert_equal :e, arg_config[:exact].aliases.first, 'The --exact option should be aliased as -e'
|
40
|
-
refute_nil arg_config[:exact].description, 'The --exact option should have a description'
|
41
|
-
refute arg_config[:exact].required, 'The --exact option should not be required'
|
42
|
-
|
43
|
-
assert_includes arg_config.keys, :'include-test-fixture', 'The search command should have an --include-test-fixture option'
|
44
|
-
assert_equal :boolean, arg_config[:'include-test-fixture'].type, 'The --include-test-fixture option should be boolean'
|
45
|
-
refute arg_config[:'include-test-fixture'].required, 'The --include-test-fixture option should not be required'
|
46
|
-
|
47
|
-
assert_equal 1, cli_class.instance_method(:search).arity, 'The search command should take one argument'
|
48
|
-
end
|
49
|
-
|
50
|
-
def test_install_args
|
51
|
-
arg_config = cli_class.all_commands['install'].options
|
52
|
-
assert_equal 1, arg_config.count, 'The install command should have 1 option'
|
53
|
-
|
54
|
-
assert_includes arg_config.keys, :version, 'The install command should have a --version option'
|
55
|
-
assert_equal :string, arg_config[:version].type, 'The --version option should be a string'
|
56
|
-
assert_equal :v, arg_config[:version].aliases.first, 'The --version option should be aliased as -v'
|
57
|
-
refute_nil arg_config[:version].description, 'The --version option should have a description'
|
58
|
-
refute arg_config[:version].required, 'The --version option should not be required'
|
59
|
-
|
60
|
-
assert_equal 1, cli_class.instance_method(:install).arity, 'The install command should take one argument'
|
61
|
-
end
|
62
|
-
|
63
|
-
def test_update_args
|
64
|
-
# TODO: allow specifying version
|
65
|
-
arg_config = cli_class.all_commands['update'].options
|
66
|
-
assert_equal 0, arg_config.count, 'The update command should have no options'
|
67
|
-
assert_equal 1, cli_class.instance_method(:update).arity, 'The update command should take one argument'
|
68
|
-
end
|
69
|
-
|
70
|
-
def test_uninstall_args
|
71
|
-
arg_config = cli_class.all_commands['uninstall'].options
|
72
|
-
assert_equal 0, arg_config.count, 'The uninstall command should have no options'
|
73
|
-
assert_equal 1, cli_class.instance_method(:uninstall).arity, 'The uninstall command should take one argument'
|
74
|
-
end
|
75
|
-
end
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require_relative '../../../shared/core_plugin_test_helper.rb'
|
2
|
-
|
3
|
-
#-----------------------------------------------------------------------#
|
4
|
-
# Plugin Definition
|
5
|
-
#-----------------------------------------------------------------------#
|
6
|
-
class PluginManagerCliDefinitionTests < MiniTest::Test
|
7
|
-
include CorePluginUnitHelper
|
8
|
-
|
9
|
-
def test_plugin_registered
|
10
|
-
loader = Inspec::Plugin::V2::Loader.new
|
11
|
-
loader.load_all # We want to ensure it is auto-loaded
|
12
|
-
|
13
|
-
assert registry.known_plugin?(:'inspec-plugin-manager-cli'), 'inspec-plugin-manager-cli should be registered'
|
14
|
-
assert registry.loaded_plugin?(:'inspec-plugin-manager-cli'), 'inspec-plugin-manager-cli should be loaded'
|
15
|
-
|
16
|
-
status = registry[:'inspec-plugin-manager-cli']
|
17
|
-
assert_equal 2, status.api_generation, 'inspec-plugin-manager-cli should be v2'
|
18
|
-
assert_includes status.plugin_types, :cli_command, 'inspec-plugin-manager-cli should have cli_command activators'
|
19
|
-
end
|
20
|
-
end
|