diff options
Diffstat (limited to 'spec/unit')
-rw-r--r-- | spec/unit/resource/windows_feature_dism.rb | 14 | ||||
-rw-r--r-- | spec/unit/resource/windows_feature_powershell.rb | 14 |
2 files changed, 24 insertions, 4 deletions
diff --git a/spec/unit/resource/windows_feature_dism.rb b/spec/unit/resource/windows_feature_dism.rb index 3885f4813e..1004b75ba9 100644 --- a/spec/unit/resource/windows_feature_dism.rb +++ b/spec/unit/resource/windows_feature_dism.rb @@ -18,7 +18,7 @@ require "spec_helper" describe Chef::Resource::WindowsFeatureDism do - let(:resource) { Chef::Resource::WindowsFeatureDism.new("SNMP") } + let(:resource) { Chef::Resource::WindowsFeatureDism.new(%w{SNMP DHCP}) } it "sets resource name as :windows_feature_dism" do expect(resource.resource_name).to eql(:windows_feature_dism) @@ -28,7 +28,17 @@ describe Chef::Resource::WindowsFeatureDism do expect(resource.action).to eql([:install]) end - it "sets the feature_name property as its name and coerces it to an array" do + it "sets the feature_name property as its name property" do + expect(resource.feature_name).to eql(%w{SNMP DHCP}) + end + + it "coerces comma separated lists of features to arrays" do + resource.feature_name "SNMP, DHCP" + expect(resource.feature_name).to eql(%w{SNMP DHCP}) + end + + it "coerces a single feature as a String into an array" do + resource.feature_name "SNMP" expect(resource.feature_name).to eql(["SNMP"]) end diff --git a/spec/unit/resource/windows_feature_powershell.rb b/spec/unit/resource/windows_feature_powershell.rb index 02f308ca73..5ea226575c 100644 --- a/spec/unit/resource/windows_feature_powershell.rb +++ b/spec/unit/resource/windows_feature_powershell.rb @@ -18,7 +18,7 @@ require "spec_helper" describe Chef::Resource::WindowsFeaturePowershell do - let(:resource) { Chef::Resource::WindowsFeaturePowershell.new("SNMP") } + let(:resource) { Chef::Resource::WindowsFeaturePowershell.new(%w{SNMP DHCP}) } it "sets resource name as :windows_feature_powershell" do expect(resource.resource_name).to eql(:windows_feature_powershell) @@ -28,7 +28,17 @@ describe Chef::Resource::WindowsFeaturePowershell do expect(resource.action).to eql([:install]) end - it "sets the feature_name property as its name and coerces it to an array" do + it "sets the feature_name property as its name property" do + expect(resource.feature_name).to eql(%w{SNMP DHCP}) + end + + it "coerces comma separated lists of features to arrays" do + resource.feature_name "SNMP, DHCP" + expect(resource.feature_name).to eql(%w{SNMP DHCP}) + end + + it "coerces a single feature as a String into an array" do + resource.feature_name "SNMP" expect(resource.feature_name).to eql(["SNMP"]) end |