From 53346e4314aed349290661cbe70c97ab573ea9bc Mon Sep 17 00:00:00 2001 From: Raphaƫl Pinson Date: Fri, 12 Apr 2013 10:45:55 +0200 Subject: Remove duplicated tests, test template override --- spec/defines/dhcp_hosts_spec.rb | 54 +++++++++-------------------------------- 1 file changed, 11 insertions(+), 43 deletions(-) (limited to 'spec') diff --git a/spec/defines/dhcp_hosts_spec.rb b/spec/defines/dhcp_hosts_spec.rb index 658be20..c8face6 100644 --- a/spec/defines/dhcp_hosts_spec.rb +++ b/spec/defines/dhcp_hosts_spec.rb @@ -317,43 +317,6 @@ describe 'dhcp::hosts' do end end - context 'when passing wrong value for fixed_address' do - let (:params) { { - :hash_data => { - 'host1' => { - 'interfaces' => { - 'eth0' => '00:11:22:33:44:55', - }, - 'fixed_address' => 'my wrong value', - }, - }, - :subnet => '1.2.3.4' - } } - - it 'should fail' do - expect { - should contain_concat__fragment('dhcp.host.My hosts') - }.to raise_error(Puppet::Error, /"my wrong value" does not match/) - end - end - - context 'when not passing fixed_address' do - let (:params) { { - :hash_data => { - 'host1' => { - 'interfaces' => { - 'eth0' => '00:11:22:33:44:55', - }, - }, - }, - :subnet => '1.2.3.4' - } } - - it { should contain_concat__fragment('dhcp.host.My hosts').with( - :content => /fixed-address host1;/ - ) } - end - context 'when not passing options' do let (:params) { { :hash_data => { @@ -400,12 +363,17 @@ describe 'dhcp::hosts' do end end - context 'when passing two entries in hash_data' do - end - - context 'when passing global_options' do - end - context 'when overriding template' do + let (:params) { { + :hash_data => {}, + :subnet => '1.2.3.4', + :template => 'wrong/path', + } } + + it 'should fail' do + expect { + should contain_concat__fragment('dhcp.host.My hosts') + }.to raise_error(Puppet::Error, /Could not find template 'wrong\/path'/) + end end end -- cgit v1.2.3