diff options
author | Tim Smith <tsmith@chef.io> | 2018-01-25 20:47:28 -0800 |
---|---|---|
committer | Tim Smith <tsmith@chef.io> | 2018-02-14 10:55:28 -0800 |
commit | 405bacfb425046d0d38521f738677d483e7cef4e (patch) | |
tree | 0e3bb266bf3e2d72689416768e2c268b5c5c9494 /spec | |
parent | c563a379b2ac9a47f5bd5c9e0c40bebed86aae8c (diff) | |
download | chef-405bacfb425046d0d38521f738677d483e7cef4e.tar.gz |
Add hostname resource from chef_hostname cookbook
Add in a new resource for managing hostnames
Signed-off-by: Tim Smith <tsmith@chef.io>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/resource/hostname_spec.rb | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/spec/unit/resource/hostname_spec.rb b/spec/unit/resource/hostname_spec.rb new file mode 100644 index 0000000000..33f944dbc9 --- /dev/null +++ b/spec/unit/resource/hostname_spec.rb @@ -0,0 +1,43 @@ +# +# Copyright:: Copyright 2018, 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::Hostname do + + let(:resource) { Chef::Resource::Hostname.new("foo") } + + it "has a resource name of :hostname" do + expect(resource.resource_name).to eql(:hostname) + end + + it "has a default action of set" do + expect(resource.action).to eql([:set]) + end + + it "runs at compile_time by default" do + expect(resource.compile_time).to eql(true) + end + + it "reboots windows nodes by default" do + expect(resource.windows_reboot).to eql(true) + end + + it "the hostname property is the name property" do + expect(resource.hostname).to eql("foo") + end +end |