diff options
author | Tim Smith <tsmith@chef.io> | 2019-02-05 12:31:57 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2019-02-05 12:31:57 -0800 |
commit | 3f74fa48873b1e616f821230ecb7b6cfea9a398b (patch) | |
tree | 8f046b7f0ec43c5b54cec2a4a3d652010db43c6b | |
parent | 5197ff6e47b9f9c53048003cbd29fa54016b16d8 (diff) | |
download | chef-3f74fa48873b1e616f821230ecb7b6cfea9a398b.tar.gz |
Add additional specs for resource propertieswindows_resources
Signed-off-by: Tim Smith <tsmith@chef.io>
-rw-r--r-- | spec/unit/resource/windows_dns_record_spec.rb | 16 | ||||
-rw-r--r-- | spec/unit/resource/windows_dns_zone_spec.rb | 12 |
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 |