mirror of
https://github.com/inspec/inspec
synced 2024-11-10 15:14:23 +00:00
fix inspec shell and continuously test it
This commit is contained in:
parent
5758f30465
commit
a9632d53d4
2 changed files with 16 additions and 1 deletions
|
@ -84,7 +84,7 @@ module Inspec
|
|||
end
|
||||
|
||||
# evaluate the test content
|
||||
tests = Array(tests) unless tests.is_a? Array
|
||||
tests = [tests] unless tests.is_a? Array
|
||||
tests.each { |t| add_test_to_context(t, ctx) }
|
||||
|
||||
# process the resulting rules
|
||||
|
|
|
@ -47,6 +47,21 @@ describe 'Inspec::InspecCLI' do
|
|||
end
|
||||
end
|
||||
|
||||
describe 'shell' do
|
||||
it 'provides a help command' do
|
||||
out = CMD.run_command("echo \"help\nexit\" | #{exec_inspec} shell")
|
||||
out.exit_status.must_equal 0
|
||||
out.stdout.must_include 'Available commands:'
|
||||
out.stdout.must_include 'You are currently running on:'
|
||||
end
|
||||
|
||||
it 'exposes all resources' do
|
||||
out = CMD.run_command("echo \"os\nexit\" | #{exec_inspec} shell")
|
||||
out.exit_status.must_equal 0
|
||||
out.stdout.must_match /^=> .*Operating.* .*System.* .*Detection.*$/
|
||||
end
|
||||
end
|
||||
|
||||
describe 'example profile' do
|
||||
let(:path) { File.join(examples_path, 'profile') }
|
||||
|
||||
|
|
Loading…
Reference in a new issue