chef-lctp/spec/coobooks/dhcp_spec.rb

19 lines
462 B
Ruby

require_relative '../spec_helper'
describe 'dhcp::default' do
let(:chef_run) do
ChefSpec::Runner.new do |node|
node.set["dhcp"]["hosts"] =[{
name: "node0",
mac: "5c:a1:ab:1e:00:01",
ip: "172.28.128.101"
}]
end.converge(described_recipe)
end
it "should setup dhcp" do
chef_run.should render_file("/etc/dhcp/dhcpd.conf").with_content("node0")
chef_run.should install_package("isc-dhcp-server")
end
end