From e7cdc4e685a73d05be05ea9d6d0f854c4a3a6ab2 Mon Sep 17 00:00:00 2001 From: Raphaƫl Pinson Date: Fri, 12 Apr 2013 11:18:56 +0200 Subject: Test working dhcp::shared_network --- spec/defines/dhcp_shared_network_spec.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'spec/defines') diff --git a/spec/defines/dhcp_shared_network_spec.rb b/spec/defines/dhcp_shared_network_spec.rb index ff5a2c5..d59f73c 100644 --- a/spec/defines/dhcp_shared_network_spec.rb +++ b/spec/defines/dhcp_shared_network_spec.rb @@ -37,7 +37,7 @@ describe 'dhcp::shared_network' do :ensure => 'present', :target => '/etc/dhcp/dhcpd.conf' ).with_content( - /shared-network My network/ + /shared-network My network \{\n\}/ ) } end @@ -67,5 +67,15 @@ describe 'dhcp::shared_network' do end context 'when passing subnets' do + let (:params) { { + :subnets => ['1.2.3.4', '5.6.7.8'], + } } + + it { should contain_concat__fragment('dhcp-shared-My network').with( + :ensure => 'present', + :target => '/etc/dhcp/dhcpd.conf' + ).with_content( + /shared-network My network \{\n include "\/etc\/dhcp\/subnets\/1\.2\.3\.4\.conf";\n include "\/etc\/dhcp\/subnets\/5\.6\.7\.8\.conf";\n\}/) + } end end -- cgit v1.2.3