summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser
diff options
context:
space:
mode:
Diffstat (limited to 'spec/integration/parser')
-rwxr-xr-xspec/integration/parser/parser.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/integration/parser/parser.rb b/spec/integration/parser/parser.rb
new file mode 100755
index 000000000..71ae136ed
--- /dev/null
+++ b/spec/integration/parser/parser.rb
@@ -0,0 +1,21 @@
+#!/usr/bin/env ruby
+
+require File.dirname(__FILE__) + '/../../spec_helper'
+
+describe Puppet::Parser::Parser do
+ before :each do
+ @loaded_code = Puppet::Parser::LoadedCode.new
+ @parser = Puppet::Parser::Parser.new :environment => "development", :loaded_code => @loaded_code
+ end
+
+ describe "when parsing comments before statement" do
+ it "should associate the documentation to the statement AST node" do
+ ast = @parser.parse("""
+ # comment
+ class test {}
+ """)
+
+ ast.hostclass("test").doc.should == "comment\n"
+ end
+ end
+end