diff options
Diffstat (limited to 'spec/integration')
| -rwxr-xr-x | spec/integration/parser/parser.rb | 21 | ||||
| -rwxr-xr-x | spec/integration/util/rdoc/parser.rb | 4 |
2 files changed, 23 insertions, 2 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 diff --git a/spec/integration/util/rdoc/parser.rb b/spec/integration/util/rdoc/parser.rb index df8c62df6..542660998 100755 --- a/spec/integration/util/rdoc/parser.rb +++ b/spec/integration/util/rdoc/parser.rb @@ -36,7 +36,7 @@ describe RDoc::Parser do end it "should parse to RDoc data structure" do - @parser.expects(:document_class).with { |n,k,c| n == "::test" and k.is_a?(Puppet::Parser::AST::HostClass) } + @parser.expects(:document_class).with { |n,k,c| n == "::test" and k.is_a?(Puppet::Parser::ResourceType) } @parser.scan end -end
\ No newline at end of file +end |
