diff options
Diffstat (limited to 'spec/unit/resource/windows_feature_dism.rb')
-rw-r--r-- | spec/unit/resource/windows_feature_dism.rb | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/spec/unit/resource/windows_feature_dism.rb b/spec/unit/resource/windows_feature_dism.rb index 4ed8f68a2a..d8a2d8187e 100644 --- a/spec/unit/resource/windows_feature_dism.rb +++ b/spec/unit/resource/windows_feature_dism.rb @@ -31,11 +31,21 @@ describe Chef::Resource::WindowsFeatureDism do expect(resource.action).to eql([:install]) end - it "sets the feature_name property as its name_property" do + it "the feature_name property is the name_property" do node.automatic[:platform_version] = "6.2" expect(resource.feature_name).to eql(%w{snmp dhcp}) end + it "sets the default action as :install" do + expect(resource.action).to eql([:install]) + end + + it "supports :install, :remove, :delete actions" do + expect { resource.action :install }.not_to raise_error + expect { resource.action :remove }.not_to raise_error + expect { resource.action :delete }.not_to raise_error + end + it "coerces comma separated lists of features to a lowercase array on 2012+" do node.automatic[:platform_version] = "6.2" resource.feature_name "SNMP, DHCP" @@ -59,11 +69,4 @@ describe Chef::Resource::WindowsFeatureDism do resource.feature_name "SNMP" expect(resource.feature_name).to eql(["SNMP"]) end - - it "supports :install, :remove, and :delete actions" do - expect { resource.action :install }.not_to raise_error - expect { resource.action :remove }.not_to raise_error - expect { resource.action :delete }.not_to raise_error - expect { resource.action :update }.to raise_error(ArgumentError) - end end |