diff options
author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-27 12:12:05 -0700 |
---|---|---|
committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-27 12:12:05 -0700 |
commit | ebf49f98357f93b33e09c0ecbdee1c5c2db87569 (patch) | |
tree | 8500c7f7c87ca5f32f22a70fde97b738c0427f54 /spec/integration/faces/documentation_spec.rb | |
parent | 1aaf5fdc51e165c7d0f377450016cd4fb3767c02 (diff) | |
parent | 0256d67e1a51a37f2c87ec197bdff6ef3a6b269f (diff) | |
download | puppet-ebf49f98357f93b33e09c0ecbdee1c5c2db87569.tar.gz puppet-ebf49f98357f93b33e09c0ecbdee1c5c2db87569.tar.xz puppet-ebf49f98357f93b33e09c0ecbdee1c5c2db87569.zip |
Merge branch 'feature/2.7.x/6962-finish-documentation-api-for-faces' into 2.7.x
Diffstat (limited to 'spec/integration/faces/documentation_spec.rb')
-rwxr-xr-x | spec/integration/faces/documentation_spec.rb | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/spec/integration/faces/documentation_spec.rb b/spec/integration/faces/documentation_spec.rb new file mode 100755 index 000000000..9ddf2f1b3 --- /dev/null +++ b/spec/integration/faces/documentation_spec.rb @@ -0,0 +1,55 @@ +#!/usr/bin/env rspec +require 'spec_helper' +require 'puppet/face' + +describe "documentation of faces" do + it "should generate global help" do + help = nil + expect { help = Puppet::Face[:help, :current].help }.not_to raise_error + help.should be_an_instance_of String + help.length.should be > 200 + end + + ######################################################################## + # Can we actually generate documentation for the face, and the actions it + # has? This avoids situations where the ERB template turns out to have a + # bug in it, triggered in something the user might do. + Puppet::Face.faces.sort.each do |face_name| + # REVISIT: We should walk all versions of the face here... + let :help do Puppet::Face[:help, :current] end + + context "generating help" do + it "for #{face_name}" do + expect { + text = help.help(face_name) + text.should be_an_instance_of String + text.length.should be > 100 + }.not_to raise_error + end + + Puppet::Face[face_name, :current].actions.sort.each do |action_name| + it "for #{face_name}.#{action_name}" do + expect { + text = help.help(face_name, action_name) + text.should be_an_instance_of String + text.length.should be > 100 + }.not_to raise_error + end + end + end + + ######################################################################## + # Ensure that we have authorship and copyright information in *our* faces; + # if you apply this to third party faces you might well be disappointed. + context "licensing of Puppet Labs face '#{face_name}'" do + subject { Puppet::Face[face_name, :current] } + its :license do should =~ /Apache\s*2/ end + its :copyright do should =~ /Puppet Labs/ end + + # REVISIT: This is less that ideal, I think, but right now I am more + # comfortable watching us ship with some copyright than without any; we + # can redress that when it becomes appropriate. --daniel 2011-04-27 + its :copyright do should =~ /2011/ end + end + end +end |