inspec/examples/profile/controls/gordon.rb
Miah Johnson 659b4b373a Remove # encoding: utf8 magic comments
Signed-off-by: Miah Johnson <miah@chia-pet.org>
2019-05-07 16:06:23 -07:00

35 lines
890 B
Ruby

# copyright: 2016, Chef Software, Inc.
title 'Gordon Config Checks'
# To pass the test, create the following file
# ```bash
# mkdir -p /tmp/gordon
# cat <<EOF > /tmp/gordon/config.yaml
# version: '1.0'
# EOF
# ```
control 'gordon-1.0' do
impact 'critical'
title 'Verify the version number of Gordon'
desc 'An optional description...'
tag 'gordon'
ref 'Gordon Requirements 1.0', uri: 'http://...'
# Test using the custom gordon_config InSpec resource
# Find the resource content here: ../libraries/
describe gordon_config do
it { should exist }
its('version') { should eq('1.0') }
its('file_size') { should <= 20 }
its('comma_count') { should eq 0 }
end
# Test the version again to showcase variables
g = gordon_config
g_path = g.file_path
g_version = g.version
describe file(g_path) do
its('content') { should match g_version }
end
end