Sha256: f8a4893d5bf369391945dad9c65331633a0a09144577b73a9132c06e0e6f7d59

Contents?: true

Size: 1.66 KB

Versions: 5

Compression:

Stored size: 1.66 KB

Contents

#
# 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::WindowsWorkgroup do
  let(:resource) { Chef::Resource::WindowsWorkgroup.new("example") }

  it "sets resource name as :windows_workgroup" do
    expect(resource.resource_name).to eql(:windows_workgroup)
  end

  it "the workgroup_name property is the name_property" do
    expect(resource.workgroup_name).to eql("example")
  end

  it "sets the default action as :join" do
    expect(resource.action).to eql([:join])
  end

  it "supports :join action" do
    expect { resource.action :join }.not_to raise_error
  end

  it "accepts :immediate, :reboot_now, :request_reboot, :delayed, or :never values for 'reboot' property" do
    expect { resource.reboot :immediate }.not_to raise_error
    expect { resource.reboot :delayed }.not_to raise_error
    expect { resource.reboot :reboot_now }.not_to raise_error
    expect { resource.reboot :request_reboot }.not_to raise_error
    expect { resource.reboot :never }.not_to raise_error
    expect { resource.reboot :nopenope }.to raise_error(ArgumentError)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chef-14.7.17 spec/unit/resource/windows_workgroup_spec.rb
chef-14.6.47 spec/unit/resource/windows_workgroup_spec.rb
chef-14.5.33 spec/unit/resource/windows_workgroup_spec.rb
chef-14.5.27 spec/unit/resource/windows_workgroup_spec.rb
chef-14.5.27-universal-mingw32 spec/unit/resource/windows_workgroup_spec.rb