From aa73753614247ae32c86222adaa5cbd70098a091 Mon Sep 17 00:00:00 2001 From: Tim Sharpe Date: Fri, 6 Apr 2012 14:23:08 -0700 Subject: [PATCH] Puppet 2.7 under 1.9.x converts all array members to strings This hack should keep things working the same under 1.8 and 1.9 --- lib/rspec-puppet/matchers/create_generic.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/rspec-puppet/matchers/create_generic.rb b/lib/rspec-puppet/matchers/create_generic.rb index f8793a4b..3f959041 100644 --- a/lib/rspec-puppet/matchers/create_generic.rb +++ b/lib/rspec-puppet/matchers/create_generic.rb @@ -50,6 +50,11 @@ def matches?(catalogue) ret = false (@errors ||= []) << "#{name.to_s} matching `#{value.inspect}` but its value of `#{rsrc_hsh[name.to_sym].inspect}` does not" end + elsif value.kind_of?(Array) then + unless rsrc_hsh[name.to_sym].join == value.join + ret = false + (@errors ||= []) << "#{name.to_s} set to `#{value.inspect}` but it is set to `#{rsrc_hsh[name.to_sym].inspect}` in the catalogue" + end else unless rsrc_hsh[name.to_sym].to_s == value.to_s ret = false