mirror of
https://github.com/inspec/inspec
synced 2025-02-16 22:18:38 +00:00
Consolidate tests and verify output contents
Signed-off-by: Jerry Aldrich <jerryaldrichiii@gmail.com>
This commit is contained in:
parent
7f4560ea7c
commit
b801bbca1c
2 changed files with 31 additions and 22 deletions
|
@ -30,14 +30,42 @@ describe 'command tests' do
|
|||
end
|
||||
|
||||
describe 'help' do
|
||||
it 'outputs the same message when using `help`, `--help`, or no args' do
|
||||
outputs = [
|
||||
let(:outputs) {
|
||||
[
|
||||
inspec('help').stdout,
|
||||
inspec('--help').stdout,
|
||||
inspec('').stdout,
|
||||
]
|
||||
}
|
||||
|
||||
it 'outputs the same message regardless of invocation' do
|
||||
outputs.uniq.length.must_equal 1
|
||||
end
|
||||
|
||||
it 'outputs both core commands and v2 CLI plugins' do
|
||||
commands = %w{
|
||||
archive
|
||||
artifact
|
||||
check
|
||||
compliance
|
||||
detect
|
||||
env
|
||||
exec
|
||||
habitat
|
||||
help
|
||||
init
|
||||
json
|
||||
plugin
|
||||
shell
|
||||
supermarket
|
||||
vendor
|
||||
version
|
||||
}
|
||||
outputs.each do |output|
|
||||
commands.each do |subcommand|
|
||||
output.must_include('inspec ' + subcommand)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -62,25 +62,6 @@ end
|
|||
#=========================================================================================#
|
||||
# See lib/plugins/inspec-plugin-manager-cli/test
|
||||
|
||||
#=========================================================================================#
|
||||
# CLI Usage Messaging
|
||||
#=========================================================================================#
|
||||
describe 'plugin cli usage message integration' do
|
||||
include FunctionalHelper
|
||||
|
||||
[' help', ''].each do |invocation|
|
||||
it "includes v2 plugins in `inspec#{invocation}` output" do
|
||||
outcome = inspec(invocation)
|
||||
outcome.stderr.must_equal ''
|
||||
|
||||
# These are some subcommands provided by core v2 plugins
|
||||
['habitat', 'artifact'].each do |subcommand|
|
||||
outcome.stdout.must_include('inspec ' + subcommand)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#=========================================================================================#
|
||||
# DSL Plugin Support
|
||||
#=========================================================================================#
|
||||
|
@ -258,4 +239,4 @@ describe 'train plugin support' do
|
|||
outcome.stdout.chomp.must_equal "Mock Command Result stdout"
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Reference in a new issue