From 37568bdd3f8cc3514eb9d0bf0eae3302686bc13d Mon Sep 17 00:00:00 2001 From: Jesse Wolfe Date: Mon, 2 Aug 2010 20:54:59 -0700 Subject: [#4423] class { shouldn't get stored on the namespace stack The new syntax for instantiating parameterized classes was confusing the lexer's notion of namespaces. This is a simple fix to prevent that syntax from polluting the namespaces. --- spec/unit/parser/lexer_spec.rb | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'spec/unit/parser') diff --git a/spec/unit/parser/lexer_spec.rb b/spec/unit/parser/lexer_spec.rb index a85d1b257..bcf49baeb 100755 --- a/spec/unit/parser/lexer_spec.rb +++ b/spec/unit/parser/lexer_spec.rb @@ -619,6 +619,12 @@ describe "Puppet::Parser::Lexer in the old tests" do @lexer.namespace.should == "base::sub" end + it "should not put class instantiation on the namespace" do + @lexer.string = "class base { class sub { class { mode" + @lexer.fullscan + @lexer.namespace.should == "base::sub" + end + it "should correctly handle fully qualified names" do @lexer.string = "class base { class sub::more {" @lexer.fullscan -- cgit