Skip to content

Commit

Permalink
Add tests for the peers parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Morgan Haskel committed Apr 8, 2015
1 parent 0b3eac9 commit e2f7aa9
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions spec/classes/ntp_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,33 @@
end
end
end

describe 'peers' do
context 'when empty' do
let(:params) do
{
:peers => []
}
end

it 'should not contain a peer line' do
should contain_file('/etc/ntp.conf').without_content(/^peer/)
end
end

context 'set' do
let(:params) do
{
:peers => ['foo', 'bar'],
}
end

it 'should contain the peer lines' do
should contain_file('/etc/ntp.conf').with_content(/peer foo/)
should contain_file('/etc/ntp.conf').with_content(/peer bar/)
end
end
end
end
end

Expand Down

0 comments on commit e2f7aa9

Please sign in to comment.