Merge pull request #41 from iankronquist/nested-classes/pdoc-35
Nested classes/pdoc 35
This commit is contained in:
commit
b1b27a33d3
|
@ -24,7 +24,7 @@ class PuppetX::PuppetLabs::Strings::YARD::PuppetParser < YARD::Parser::Base
|
||||||
statements = @transformer.transform(@parse_result)
|
statements = @transformer.transform(@parse_result)
|
||||||
|
|
||||||
# Ensure an array is returned and prune any nil values.
|
# Ensure an array is returned and prune any nil values.
|
||||||
Array(statements).compact
|
Array(statements).compact.reverse
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
@ -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
|
||||||
|
) {}
|
||||||
|
}
|
||||||
|
}
|
|
@ -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")
|
expect(read_html(tmp, 'test', 'Puppet4xFunctions.html')).to include("This is a function which is used to test puppet strings")
|
||||||
end
|
end
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue