inspec/test/functional/inspec_test.rb

32 lines
806 B
Ruby
Raw Normal View History

2016-03-25 00:31:19 +00:00
# encoding: utf-8
require 'functional/helper'
describe 'command tests' do
include FunctionalHelper
describe 'version' do
it 'provides the version number on stdout' do
out = inspec('version')
out.stderr.must_equal ''
out.exit_status.must_equal 0
out.stdout.must_equal Inspec::VERSION+"\n"
end
it 'prints the version as JSON when the format is specified as JSON' do
out = inspec('version --format=json')
out.stderr.must_equal ''
out.exit_status.must_equal 0
out.stdout.must_equal %({"version":"#{Inspec::VERSION}"}\n)
end
2016-03-25 00:31:19 +00:00
end
describe 'check' do
it 'verifies that a profile is ok' do
out = inspec('check ' + example_profile)
out.stdout.must_match(/Valid.*true/)
2016-03-25 00:31:19 +00:00
out.exit_status.must_equal 0
end
end
end