From d69fffb63ca9efe3cca67167430b23d3b8d38fa4 Mon Sep 17 00:00:00 2001 From: Brice Figureau Date: Sat, 30 May 2009 20:15:08 +0200 Subject: Fix #2246 - Array tagged resources can't be collected or exported I don't know why we imposed the restriction that we shouldn't match with parameter containing arrays in exported mode. That doesn't seem right, as the produced rails query works fine with arrays. Note: the user tags are not stored in the rails database except under the special resource parameter tag. This also doesn't seem right. Signed-off-by: Brice Figureau --- spec/unit/parser/ast/collexpr.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'spec/unit/parser') diff --git a/spec/unit/parser/ast/collexpr.rb b/spec/unit/parser/ast/collexpr.rb index 51cd820a2..e45203492 100755 --- a/spec/unit/parser/ast/collexpr.rb +++ b/spec/unit/parser/ast/collexpr.rb @@ -74,16 +74,18 @@ describe Puppet::Parser::AST::CollExpr do end end - it "should check for array member equality if resource parameter is an array for ==" do + [:exported,:virtual].each do |mode| + it "should check for array member equality if resource parameter is an array for == in mode #{mode}" do array = mock 'array', :safeevaluate => "array" test1 = mock 'test1' test1.expects(:safeevaluate).with(@scope).returns("test1") resource = mock 'resource' resource.expects(:[]).with("array").at_least(1).returns(["test1","test2","test3"]) - collexpr = ast::CollExpr.new(:test1 => array, :test2 => test1, :oper => "==") + collexpr = ast::CollExpr.new(:test1 => array, :test2 => test1, :oper => "==", :form => mode) collexpr.evaluate(@scope)[1].call(resource).should be_true end + end it "should raise an error for invalid operator" do lambda { collexpr = ast::CollExpr.new(:oper=>">") }.should raise_error -- cgit