diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-02 21:15:55 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:02 -0700 |
commit | bc1e95879f2ff79165bad8677f39888853453aa4 (patch) | |
tree | 8d6d7581fabaa27a5b2c8deae189da22f042fe4b /spec/unit/platform | |
parent | 60e93f358f30ad229e7a31e8c92a49687e0bf858 (diff) | |
download | chef-bc1e95879f2ff79165bad8677f39888853453aa4.tar.gz |
Added spec for supports_dsc_invoke_resource?
Diffstat (limited to 'spec/unit/platform')
-rw-r--r-- | spec/unit/platform/query_helpers_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/unit/platform/query_helpers_spec.rb b/spec/unit/platform/query_helpers_spec.rb index 7aafc287ea..1dbd07a021 100644 --- a/spec/unit/platform/query_helpers_spec.rb +++ b/spec/unit/platform/query_helpers_spec.rb @@ -53,3 +53,25 @@ describe 'Chef::Platform#supports_dsc?' do end end end + +describe 'Chef::Platform#supports_dsc_invoke_resource?' do + it 'returns false if powershell is not present' do + node = Chef::Node.new + expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_falsey + end + + ['1.0', '2.0', '3.0', '4.0', '5.0.10017.9'].each do |version| + it "returns false for Powershell #{version}" do + node = Chef::Node.new + node.automatic[:languages][:powershell][:version] = version + expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_falsey + end + end + + it "returns true for Powershell 5.0.10018.0" do + node = Chef::Node.new + node.automatic[:languages][:powershell][:version] = "5.0.10018.0" + expect(Chef::Platform.supports_dsc_invoke_resource?(node)).to be_truthy + end +end + |