summaryrefslogtreecommitdiff
path: root/spec/unit/resource
diff options
context:
space:
mode:
authorTim Smith <tsmith@chef.io>2019-02-02 10:09:47 -0800
committerTim Smith <tsmith@chef.io>2019-02-02 10:09:47 -0800
commit2146563c2f305fd5dfab00b0e1ed07ee33884212 (patch)
tree1267c2c4c948515a69910dfa71aaf226ba6a7c77 /spec/unit/resource
parent0f4bd34e95111d755b646d85150698626e27fa3d (diff)
downloadchef-2146563c2f305fd5dfab00b0e1ed07ee33884212.tar.gz
Add windows_dfs and windows_dns resources
These are ported over from the windows_dns and windows_dfs cookbooks. Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec/unit/resource')
-rw-r--r--spec/unit/resource/windows_dfs_folder_spec.rb39
-rw-r--r--spec/unit/resource/windows_dfs_namespace_spec.rb39
-rw-r--r--spec/unit/resource/windows_dfs_server_spec.rb34
-rw-r--r--spec/unit/resource/windows_dns_record_spec.rb39
-rw-r--r--spec/unit/resource/windows_dns_zone_spec.rb39
5 files changed, 190 insertions, 0 deletions
diff --git a/spec/unit/resource/windows_dfs_folder_spec.rb b/spec/unit/resource/windows_dfs_folder_spec.rb
new file mode 100644
index 0000000000..04436b9fca
--- /dev/null
+++ b/spec/unit/resource/windows_dfs_folder_spec.rb
@@ -0,0 +1,39 @@
+#
+# Copyright:: Copyright 2019, Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsDfsFolder do
+ let(:resource) { Chef::Resource::WindowsDfsFolder.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_dfs_folder" do
+ expect(resource.resource_name).to eql(:windows_dfs_folder)
+ end
+
+ it "the folder_path property is the name_property" do
+ expect(resource.folder_path).to eql("fakey_fakerton")
+ end
+
+ it "sets the default action as :install" do
+ expect(resource.action).to eql([:install])
+ end
+
+ it "supports :install and :delete actions" do
+ expect { resource.action :install }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
+ end
+end
diff --git a/spec/unit/resource/windows_dfs_namespace_spec.rb b/spec/unit/resource/windows_dfs_namespace_spec.rb
new file mode 100644
index 0000000000..9830471b78
--- /dev/null
+++ b/spec/unit/resource/windows_dfs_namespace_spec.rb
@@ -0,0 +1,39 @@
+#
+# Copyright:: Copyright 2019, Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsDfsNamespace do
+ let(:resource) { Chef::Resource::WindowsDfsNamespace.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_dfs_namespace" do
+ expect(resource.resource_name).to eql(:windows_dfs_namespace)
+ end
+
+ it "the namespace_name property is the name_property" do
+ expect(resource.namespace_name).to eql("fakey_fakerton")
+ end
+
+ it "sets the default action as :install" do
+ expect(resource.action).to eql([:install])
+ end
+
+ it "supports :install and :delete actions" do
+ expect { resource.action :install }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
+ end
+end
diff --git a/spec/unit/resource/windows_dfs_server_spec.rb b/spec/unit/resource/windows_dfs_server_spec.rb
new file mode 100644
index 0000000000..170aa91bcb
--- /dev/null
+++ b/spec/unit/resource/windows_dfs_server_spec.rb
@@ -0,0 +1,34 @@
+#
+# Copyright:: Copyright 2019, Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsDfsServer do
+ let(:resource) { Chef::Resource::WindowsDfsServer.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_dfs_server" do
+ expect(resource.resource_name).to eql(:windows_dfs_server)
+ end
+
+ it "sets the default action as :configure" do
+ expect(resource.action).to eql([:configure])
+ end
+
+ it "supports :configure action" do
+ expect { resource.action :configure }.not_to raise_error
+ end
+end
diff --git a/spec/unit/resource/windows_dns_record_spec.rb b/spec/unit/resource/windows_dns_record_spec.rb
new file mode 100644
index 0000000000..d06224b872
--- /dev/null
+++ b/spec/unit/resource/windows_dns_record_spec.rb
@@ -0,0 +1,39 @@
+#
+# Copyright:: Copyright 2019, Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsDnsRecord do
+ let(:resource) { Chef::Resource::WindowsDnsRecord.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_dns_record" do
+ expect(resource.resource_name).to eql(:windows_dns_record)
+ end
+
+ it "the record_name property is the name_property" do
+ expect(resource.record_name).to eql("fakey_fakerton")
+ end
+
+ it "sets the default action as :create" do
+ expect(resource.action).to eql([:create])
+ end
+
+ it "supports :create and :delete actions" do
+ expect { resource.action :create }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
+ end
+end
diff --git a/spec/unit/resource/windows_dns_zone_spec.rb b/spec/unit/resource/windows_dns_zone_spec.rb
new file mode 100644
index 0000000000..638b267d99
--- /dev/null
+++ b/spec/unit/resource/windows_dns_zone_spec.rb
@@ -0,0 +1,39 @@
+#
+# Copyright:: Copyright 20189, Chef Software, Inc.
+# License:: Apache License, Version 2.0
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+require "spec_helper"
+
+describe Chef::Resource::WindowsDnsZone do
+ let(:resource) { Chef::Resource::WindowsDnsZone.new("fakey_fakerton") }
+
+ it "sets resource name as :windows_dns_zone" do
+ expect(resource.resource_name).to eql(:windows_dns_zone)
+ end
+
+ it "the zone_name property is the name_property" do
+ expect(resource.zone_name).to eql("fakey_fakerton")
+ end
+
+ it "sets the default action as :create" do
+ expect(resource.action).to eql([:create])
+ end
+
+ it "supports :create and :delete actions" do
+ expect { resource.action :create }.not_to raise_error
+ expect { resource.action :delete }.not_to raise_error
+ end
+end