fix inspec shell and continuously test it

This commit is contained in:
Dominik Richter 2016-03-19 09:13:23 +01:00
parent 5758f30465
commit a9632d53d4
2 changed files with 16 additions and 1 deletions

View file

@ -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

View file

@ -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') }