spec/unit/mcollective/matcher/parser_spec.rb in mcollective-client-2.8.8 vs spec/unit/mcollective/matcher/parser_spec.rb in mcollective-client-2.8.9
- old
+ new
@@ -103,11 +103,11 @@
{")"=>")"}, {"and"=>"and"}, {"("=>"("}, {"statement"=>"bar=foo"},
{")"=>")"}]
end
it "should parse complex fstatements and statements with operators seperated by whitespaces" do
- parser = Parser.new("foo('bar').value = 1 and foo=bar or foo = bar")
- parser.execution_stack.should == [{"fstatement"=>"foo('bar').value=1"}, {"and"=>"and"}, {"statement"=>"foo=bar"}, {"or"=>"or"}, {"statement"=>"foo=bar"}]
+ parser = Parser.new(%q(foo('bar').value = 1 and foo=bar or foo = bar and baz("abc") = "xyz"))
+ parser.execution_stack.should == [{"fstatement"=>"foo('bar').value=1"}, {"and"=>"and"}, {"statement"=>"foo=bar"}, {"or"=>"or"}, {"statement"=>"foo=bar"}, {"and"=>"and"}, {"fstatement"=>'baz("abc")=xyz'}]
end
it "should parse statements where classes are mixed with fact comparisons and fstatements" do
parser = Parser.new("klass and function('param').value = 1 and fact=value")
parser.execution_stack.should == [{"statement" => "klass"},