chef-lctp/spec/coobooks/bind_spec.rb

28 lines
938 B
Ruby
Raw Normal View History

2014-01-19 14:34:01 +00:00
require_relative '../spec_helper'
describe 'bind::default' do
let(:chef_run) do
ChefSpec::Runner.new do |node|
node.set["bind"] = {
zones: {
"lctp" => {
records: [{ name: "node1", type: "A", value: "172.28.128.101" }]
},
2014-01-20 15:10:18 +00:00
"128.28.172.in-addr.arpa" => {
2014-01-19 14:34:01 +00:00
records: [{ name: "101", type: "PTR", value: "node1" }]
}
},
trusted_subnets: ["localhost", "localnets", "172.28.128.101"]
}
end.converge(described_recipe)
end
it "should setup named" do
chef_run.should render_file("/etc/bind/named.conf").with_content("lctp")
chef_run.should render_file("/etc/bind/named.conf.options").with_content("8.8.8.8")
2014-01-20 15:10:18 +00:00
chef_run.should render_file("/etc/bind/lctp").with_content("node1")
chef_run.should render_file("/etc/bind/128.28.172.in-addr.arpa").with_content("node1")
2014-01-19 14:34:01 +00:00
chef_run.should install_package("bind9")
end
end