summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorBrice Figureau <brice-puppet@daysofwonder.com>2011-02-11 20:34:22 +0100
committerBrice Figureau <brice-puppet@daysofwonder.com>2011-02-11 20:34:22 +0100
commitcfa0c32fc5149464af97235a7bb458950d19cc82 (patch)
tree704414bedb586291897a6064a7e7570394429808 /spec
parent48bc7d00ca87fa92cdde0b993529bba3827fa47e (diff)
downloadpuppet-cfa0c32fc5149464af97235a7bb458950d19cc82.tar.gz
puppet-cfa0c32fc5149464af97235a7bb458950d19cc82.tar.xz
puppet-cfa0c32fc5149464af97235a7bb458950d19cc82.zip
Fix #6281 - Make sure puppetdoc analyzes all files
It can happen that when parsing a file puppet parses other manifests if they get imported (this is at least true for site.pp, even in ignoreimport=true). Thus those files are now "watched". But puppetdoc needs to analyze all files, and since 99c101 we are now checking if the file was already parsed to not reparse it again. If that was the case, though, we weren't analyzing the produced code. Thus it was possible to not produce documentation for the site.pp content. Signed-off-by: Brice Figureau <brice-puppet@daysofwonder.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/util/rdoc/parser_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/util/rdoc/parser_spec.rb b/spec/unit/util/rdoc/parser_spec.rb
index 3295e9031..b4453ae86 100755
--- a/spec/unit/util/rdoc/parser_spec.rb
+++ b/spec/unit/util/rdoc/parser_spec.rb
@@ -43,6 +43,18 @@ describe RDoc::Parser do
@parser.scan.should be_a(RDoc::PuppetTopLevel)
end
+
+ it "should scan the top level even if the file has already parsed" do
+ known_type = stub 'known_types'
+ env = stub 'env'
+ Puppet::Node::Environment.stubs(:new).returns(env)
+ env.stubs(:known_resource_types).returns(known_type)
+ known_type.expects(:watching_file?).with("module/manifests/init.pp").returns(true)
+
+ @parser.expects(:scan_top_level)
+
+ @parser.scan
+ end
end
describe "when scanning top level entities" do