(PDOC-35) Test strings works with nested classes

This commit is contained in:
Ian Kronquist 2015-07-27 11:13:53 -07:00
parent 4dc6bc429a
commit 457ec86a2b
2 changed files with 57 additions and 0 deletions

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") 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