From 15bb70eb9453ecb02757d718af1d397dd89d6603 Mon Sep 17 00:00:00 2001 From: Jordi Prats Date: Mon, 5 Aug 2019 13:22:40 +0200 Subject: [PATCH] testing legal stuff --- spec/acceptance/base_spec.rb | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/spec/acceptance/base_spec.rb b/spec/acceptance/base_spec.rb index 591451f..fe251a5 100644 --- a/spec/acceptance/base_spec.rb +++ b/spec/acceptance/base_spec.rb @@ -32,6 +32,38 @@ class { 'eyplib::autobanner': } it { should be_file } its(:content) { should match 'ACCEPTANCE TESTING' } end + end + context 'legal setup' do + # Using puppet_apply as a helper + it 'should work with no errors' do + pp = <<-EOF + + class { 'eyplib': } + + -> + + class { 'eyplib::setdescription': + description => 'ACCEPTANCE TESTING', + } + + -> + class { 'eyplib::autobanner': + include_legal => true, + } + + EOF + + # run several times - expect the 3rd run to be clean + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to_not eq(1) + expect(apply_manifest(pp).exit_code).to eq(0) + end + + describe file('/opt/eypconf/autobanner') do + it { should be_file } + its(:content) { should match 'ACCEPTANCE TESTING' } + its(:content) { should match 'This is a private system!!! All connection attempts are logged and' } + end end end