summaryrefslogtreecommitdiffstats
path: root/spec/integration/parser/parser.rb
blob: 5a30f066ea07acdbda2fcda2c1e4f1970b0d253f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

require File.dirname(__FILE__) + '/../../spec_helper'

describe Puppet::Parser::Parser do
    before :each do
        @resource_type_collection = Puppet::Resource::TypeCollection.new("env")
        @parser = Puppet::Parser::Parser.new "development"
    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