style(inspec): match current practices for file and control names

I don't find a reference best practices in the documentation but as
stated during a SaltStack Formula Workgroup meeting:

- the `_spec` in the control file name is inherited from RSpec and few
  examples use it

- the `control` name should be an identifier, I matched the `tpldot`
  name

- the `title` is a human readable description of the `control`

- remove `impact` which is not appropriate for an integration test
This commit is contained in:
Daniel Dehennin 2021-02-10 23:02:25 +01:00
parent 978a7e7cd0
commit aa8a58b715
6 changed files with 11 additions and 12 deletions

View file

@ -18,7 +18,7 @@
/*/_mapdata/ @saltstack-formulas/ssf
/*/libsaltcli.jinja @saltstack-formulas/ssf
/*/libtofs.jinja @saltstack-formulas/ssf
/test/integration/**/_mapdata_spec.rb @saltstack-formulas/ssf
/test/integration/**/_mapdata.rb @saltstack-formulas/ssf
/test/integration/**/libraries/system.rb @saltstack-formulas/ssf
/test/integration/**/inspec.yml @saltstack-formulas/ssf
/test/integration/**/README.md @saltstack-formulas/ssf

View file

@ -2,8 +2,8 @@
require 'yaml'
control '`map.jinja` YAML dump' do
title 'should match the comparison file'
control 'TEMPLATE._mapdata' do
title '`map.jinja` should match the reference file'
### Method
# The steps below for each file appear convoluted but they are both required

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
control 'TEMPLATE configuration' do
title 'should match desired lines'
control 'TEMPLATE.config.file' do
title 'Verify the configuration file'
describe file('/etc/template-formula.conf') do
it { should be_file }

View file

@ -3,8 +3,8 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE package' do
title 'should be installed'
control 'TEMPLATE.package.install' do
title 'The required package should be installed'
# Overide by `platform_finger`
package_name =

View file

@ -3,9 +3,8 @@
# Prepare platform "finger"
platform_finger = system.platform[:finger].split('.').first.to_s
control 'TEMPLATE service' do
impact 0.5
title 'should be running and enabled'
control 'TEMPLATE.service.running' do
title 'The service should be installed, enabled and running'
# Overide by `platform_finger`
service_name =

View file

@ -1,7 +1,7 @@
# frozen_string_literal: true
control 'TEMPLATE subcomponent configuration' do
title 'should match desired lines'
control 'TEMPLATE.subcomponent.config.file' do
title 'Verify the subcomponent configuration file'
describe file('/etc/TEMPLATE-subcomponent-formula.conf') do
it { should be_file }