diff options
author | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-04 19:18:32 -0800 |
---|---|---|
committer | Jay Mundrawala <jdmundrawala@gmail.com> | 2015-03-20 14:38:03 -0700 |
commit | 6ffe92446118a9c56e793f42158f35d423d081a7 (patch) | |
tree | 897563ba2a509af1a2dbf297727751ec1c396cb7 /spec/unit/mixin | |
parent | 377ec3040dd3ec2b4fc4b4e66d5ca71ab79dd1b7 (diff) | |
download | chef-6ffe92446118a9c56e793f42158f35d423d081a7.tar.gz |
Update PowershelTypeCoercions to call to_psobject
Diffstat (limited to 'spec/unit/mixin')
-rw-r--r-- | spec/unit/mixin/powershell_type_coercions_spec.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/spec/unit/mixin/powershell_type_coercions_spec.rb b/spec/unit/mixin/powershell_type_coercions_spec.rb index 4cca7e2f1f..a6b944adda 100644 --- a/spec/unit/mixin/powershell_type_coercions_spec.rb +++ b/spec/unit/mixin/powershell_type_coercions_spec.rb @@ -47,5 +47,11 @@ describe Chef::Mixin::PowershellTypeCoercions do expect(test_class.translate_type({"a" => 1, "b" => 1.2, "c" => false, "d" => true })).to eq("@{a=1;b=1.2;c=$false;d=$true}") end + + it 'should fall back :to_psobject if we have not defined at explicit rule' do + ps_obj = double("PSObject") + expect(ps_obj).to receive(:to_psobject).and_return('$true') + expect(test_class.translate_type(ps_obj)).to eq('($true)') + end end end |