summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/unit/resource/windows_dns_record_spec.rb16
-rw-r--r--spec/unit/resource/windows_dns_zone_spec.rb12
2 files changed, 28 insertions, 0 deletions
diff --git a/spec/unit/resource/windows_dns_record_spec.rb b/spec/unit/resource/windows_dns_record_spec.rb
index d06224b872..4288477fea 100644
--- a/spec/unit/resource/windows_dns_record_spec.rb
+++ b/spec/unit/resource/windows_dns_record_spec.rb
@@ -28,6 +28,22 @@ describe Chef::Resource::WindowsDnsRecord do
expect(resource.record_name).to eql("fakey_fakerton")
end
+ it "the record_type property accepts 'CNAME'" do
+ expect { resource.record_type "CNAME" }.not_to raise_error(ArgumentError)
+ end
+
+ it "the record_type property accepts 'ARecord'" do
+ expect { resource.record_type "ARecord" }.not_to raise_error(ArgumentError)
+ end
+
+ it "the record_type property accepts 'PTR'" do
+ expect { resource.record_type "PTR" }.not_to raise_error(ArgumentError)
+ end
+
+ it "the resource raises an ArgumentError if invalid record_type is set" do
+ expect { resource.record_type "NOPE" }.to raise_error(ArgumentError)
+ end
+
it "sets the default action as :create" do
expect(resource.action).to eql([:create])
end
diff --git a/spec/unit/resource/windows_dns_zone_spec.rb b/spec/unit/resource/windows_dns_zone_spec.rb
index 910b41a93a..f31afa0373 100644
--- a/spec/unit/resource/windows_dns_zone_spec.rb
+++ b/spec/unit/resource/windows_dns_zone_spec.rb
@@ -28,6 +28,18 @@ describe Chef::Resource::WindowsDnsZone do
expect(resource.zone_name).to eql("fakey_fakerton")
end
+ it "the server_type property accepts 'Standalone'" do
+ expect { resource.server_type "Standalone" }.not_to raise_error(ArgumentError)
+ end
+
+ it "the server_type property accepts 'Domain'" do
+ expect { resource.server_type "Domain" }.not_to raise_error(ArgumentError)
+ end
+
+ it "the resource raises an ArgumentError if invalid server_type is set" do
+ expect { resource.server_type "NOPE" }.to raise_error(ArgumentError)
+ end
+
it "sets the default action as :create" do
expect(resource.action).to eql([:create])
end