diff options
author | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-04-12 10:45:55 +0200 |
---|---|---|
committer | Raphaël Pinson <raphael.pinson@camptocamp.com> | 2013-04-12 10:45:55 +0200 |
commit | 53346e4314aed349290661cbe70c97ab573ea9bc (patch) | |
tree | d6f23c2873e75d725f80fd9b49a108c0f1bf7c8b /spec/defines/dhcp_hosts_spec.rb | |
parent | f4e7bdf477586e34e47a972172c15809ac92fe3c (diff) | |
download | puppet-dhcp-53346e4314aed349290661cbe70c97ab573ea9bc.tar.gz puppet-dhcp-53346e4314aed349290661cbe70c97ab573ea9bc.tar.bz2 |
Remove duplicated tests, test template override
Diffstat (limited to 'spec/defines/dhcp_hosts_spec.rb')
-rw-r--r-- | spec/defines/dhcp_hosts_spec.rb | 54 |
1 files changed, 11 insertions, 43 deletions
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 |