0
0
mirror of https://github.com/saltstack-formulas/openssh-formula.git synced 2024-11-28 12:07:25 +01:00
openssh-formula/test/integration/default/controls/_mapdata_spec.rb
Daniel Dehennin 1c99556695 test(inspec): display proper diff when _mapdata mismatch
The use of `eq` instead of `include` premits to have a nice diff after
the `expected/got` oneliners.
2020-08-26 10:06:13 +02:00

19 lines
448 B
Ruby

# frozen_string_literal: true
# Replace per minion strings
replacement = {
hostname: system.hostname
}
mapdata_file = "_mapdata/#{system.platform[:finger].split('.').first}.yaml"
mapdata_dump = inspec.profile.file(mapdata_file) % replacement
control '`map.jinja` YAML dump' do
title 'should contain the lines'
describe file('/tmp/salt_mapdata_dump.yaml') do
it { should exist }
its('content') { should eq mapdata_dump }
end
end