From dc9c9d6647ad67ab9f94f8f2b997471414fc43a4 Mon Sep 17 00:00:00 2001 From: Christer Ekholm Date: Mon, 13 Jul 2020 15:27:31 +0200 Subject: [PATCH] Add tests for detecting double blank lines. --- spec/classes/chrony_spec.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spec/classes/chrony_spec.rb b/spec/classes/chrony_spec.rb index 2b43a7d..ab21ac9 100644 --- a/spec/classes/chrony_spec.rb +++ b/spec/classes/chrony_spec.rb @@ -34,6 +34,7 @@ it { is_expected.to contain_file('/etc/chrony.conf').with_content(%r{^\s*driftfile /var/lib/chrony/drift$}) } it { is_expected.to contain_file('/etc/chrony.conf').with_content(%r{^\s*rtcsync$}) } it { is_expected.to contain_file('/etc/chrony.conf').with_content(%r{^\s*dumpdir /var/log/chrony$}) } + it { is_expected.to contain_file('/etc/chrony.conf').without_content(%r{^\s*\n\s*$}) } it { is_expected.to contain_file('/etc/chrony.keys').with_mode('0644') } it { is_expected.to contain_file('/etc/chrony.keys').with_owner('0') } it { is_expected.to contain_file('/etc/chrony.keys').with_group('0') } @@ -53,6 +54,7 @@ .with_content(%r{^\s*driftfile /var/lib/chrony/drift$}) .with_content(%r{^\s*rtcsync$}) .without_content(%r{^\s*dumpdir}) + .without_content(%r{^\s*\n\s*$}) end it do is_expected.to contain_file('/etc/chrony/chrony.keys') @@ -74,6 +76,7 @@ it { is_expected.to contain_file('/etc/chrony.conf').with_content(%r{^\s*driftfile /var/lib/chrony/drift$}) } it { is_expected.to contain_file('/etc/chrony.conf').with_content(%r{^\s*rtcsync$}) } it { is_expected.to contain_file('/etc/chrony.conf').without_content(%r{^\s*dumpdir}) } + it { is_expected.to contain_file('/etc/chrony.conf').without_content(%r{^\s*\n\s*$}) } it { is_expected.to contain_file('/etc/chrony.keys').with_mode('0640') } it { is_expected.to contain_file('/etc/chrony.keys').with_owner('0') } it { is_expected.to contain_file('/etc/chrony.keys').with_group('chrony') } @@ -91,6 +94,7 @@ it { is_expected.to contain_file('/etc/chrony/chrony.conf').with_content(%r{^\s*driftfile /var/lib/chrony/drift$}) } it { is_expected.to contain_file('/etc/chrony/chrony.conf').with_content(%r{^\s*rtcsync$}) } it { is_expected.to contain_file('/etc/chrony/chrony.conf').without_content(%r{^\s*dumpdir}) } + it { is_expected.to contain_file('/etc/chrony/chrony.conf').without_content(%r{^\s*\n\s*$}) } it { is_expected.to contain_file('/etc/chrony/chrony.keys').with_mode('0640') } it { is_expected.to contain_file('/etc/chrony/chrony.keys').with_owner('0') } it { is_expected.to contain_file('/etc/chrony/chrony.keys').with_group('0') }