Merge pull request #41 from iankronquist/nested-classes/pdoc-35

Nested classes/pdoc 35
This commit is contained in:
Hailee Kenney 2015-07-30 14:07:10 -07:00
commit b1b27a33d3
3 changed files with 58 additions and 1 deletions

View File

@ -24,7 +24,7 @@ class PuppetX::PuppetLabs::Strings::YARD::PuppetParser < YARD::Parser::Base
statements = @transformer.transform(@parse_result)
# Ensure an array is returned and prune any nil values.
Array(statements).compact
Array(statements).compact.reverse
end
end

View File

@ -0,0 +1,27 @@
# Testing tested classes
# docs stuff
# @param nameservers [String] Don't ask me what this does!
# @param default_lease_time [Integer[1024, 8192]] text goes here
# @param max_lease_time does stuff
class outer (
$dnsdomain,
$nameservers,
$default_lease_time = 3600,
$max_lease_time = 86400
) {
# @param options [String[5,7]] gives user choices
# @param multicast [Boolean] foobar
# @param servers yep, that's right
class middle (
$options = "iburst",
$servers,
$multicast = false
) {
class inner (
$choices = "uburst",
$secenekler = "weallburst",
$boxen,
$manyspell = true
) {}
}
}

View File

@ -79,6 +79,36 @@ describe Puppet::Face do
expect(read_html(tmp, 'test', 'Puppet4xFunctions.html')).to include("This is a function which is used to test puppet strings")
end
end
it "should create correct files for nested classes" do
using_module('test') do |tmp|
Dir.chdir('test')
Puppet::Face[:strings, :current].yardoc
expect(read_html(tmp,
'test', 'outer.html')).to include("Puppet Class: outer")
expect(read_html(tmp, 'test',
'outer/middle.html')).to include("Puppet Class: middle")
expect(read_html(tmp, 'test',
'outer/middle/inner.html')).to include("Puppet Class: inner")
end
end
it "should create proper namespace for nested classes" do
using_module('test') do |tmp|
Dir.chdir('test')
Puppet::Face[:strings, :current].yardoc
expect(read_html(tmp,
'test', 'outer.html')).to include("Hostclass: outer")
expect(read_html(tmp, 'test',
'outer/middle.html')).to include("Hostclass: outer::middle")
expect(read_html(tmp, 'test',
'outer/middle/inner.html')).to include("Hostclass: outer::middle::inner")
end
end
end
end