summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2018-02-23 11:32:24 -0800
committerLamont Granquist <lamont@scriptkiddie.org>2018-02-23 11:32:24 -0800
commit19bfa923f3e16a42c80c079ecb8c8815305a3420 (patch)
treede682276d61617aa7f5133e67321b5eaedbdc41c
parentc96a8e88f9784311e6c557d6bc890028db8edbb7 (diff)
downloadchef-19bfa923f3e16a42c80c079ecb8c8815305a3420.tar.gz
Revert "Revert "fixup some unit tests""lcg/revert-revert-derp
This reverts commit 0eaff267cf603e8494c0a9e631d84f89f3ac179a.
-rw-r--r--spec/unit/mixin/powershell_type_coercions_spec.rb13
1 files changed, 7 insertions, 6 deletions
diff --git a/spec/unit/mixin/powershell_type_coercions_spec.rb b/spec/unit/mixin/powershell_type_coercions_spec.rb
index 6f52abccfb..159a0a8d1d 100644
--- a/spec/unit/mixin/powershell_type_coercions_spec.rb
+++ b/spec/unit/mixin/powershell_type_coercions_spec.rb
@@ -1,6 +1,6 @@
#
# Author:: Jay Mundrawala (<jdm@chef.io>)
-# Copyright:: Copyright 2015-2016, Chef Software, Inc.
+# Copyright:: Copyright 2015-2017, Chef Software Inc.
# License:: Apache License, Version 2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -64,14 +64,15 @@ describe Chef::Mixin::PowershellTypeCoercions do
end
it "translates a Chef::Node::ImmutableMash like a hash" do
- test_mash = Chef::Node::ImmutableMash.new({ "a" => 1, "b" => 1.2,
- "c" => false, "d" => true })
- expect(test_class.translate_type(test_mash)).to eq("@{a=1;b=1.2;c=$false;d=$true}")
+ node = Chef::Node.new
+ node.default[:test] = { "a" => 1, "b" => 1.2, "c" => false, "d" => true }
+ expect(test_class.translate_type(node[:test])).to eq("@{a=1;b=1.2;c=$false;d=$true}")
end
it "translates a Chef::Node::ImmutableArray like an array" do
- test_array = Chef::Node::ImmutableArray.new([true, false])
- expect(test_class.translate_type(test_array)).to eq("@($true,$false)")
+ node = Chef::Node.new
+ node.default[:test] = [ true, false ]
+ expect(test_class.translate_type(node[:test])).to eq("@($true,$false)")
end
it "falls back :to_psobject if we have not defined at explicit rule" do