summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorLuke Kanies <luke@puppetlabs.com>2011-04-14 16:48:40 -0700
committerLuke Kanies <luke@puppetlabs.com>2011-04-14 16:48:40 -0700
commitff08ba2abc8a59caa2bae0cde0a84ded99337e1c (patch)
treeb4d4ec2b8dbfb08bf812ce3d353f9af483745007 /spec
parentba9bd88b8b60ebe567a6d78d70782610cc281213 (diff)
downloadpuppet-ff08ba2abc8a59caa2bae0cde0a84ded99337e1c.tar.gz
puppet-ff08ba2abc8a59caa2bae0cde0a84ded99337e1c.tar.xz
puppet-ff08ba2abc8a59caa2bae0cde0a84ded99337e1c.zip
(7118) Adding summaries for all faces
It's usually just a one-liner, but when I saw an obvious opportunity for longer docs, I've added a @longdocs variable that can be converted to longer forms when ready. Signed-off-by: Luke Kanies <luke@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-xspec/lib/puppet/face/basetest.rb4
-rwxr-xr-xspec/unit/application/indirection_base_spec.rb1
-rwxr-xr-xspec/unit/face/help_spec.rb15
3 files changed, 17 insertions, 3 deletions
diff --git a/spec/lib/puppet/face/basetest.rb b/spec/lib/puppet/face/basetest.rb
index 00616f74f..9a658b685 100755
--- a/spec/lib/puppet/face/basetest.rb
+++ b/spec/lib/puppet/face/basetest.rb
@@ -1 +1,3 @@
-Puppet::Face.define(:basetest, '0.0.1')
+Puppet::Face.define(:basetest, '0.0.1') do
+ summary "This is just so tests don't fail"
+end
diff --git a/spec/unit/application/indirection_base_spec.rb b/spec/unit/application/indirection_base_spec.rb
index 63ab11eed..dedadb4ad 100755
--- a/spec/unit/application/indirection_base_spec.rb
+++ b/spec/unit/application/indirection_base_spec.rb
@@ -9,6 +9,7 @@ class Puppet::Application::TestIndirection < Puppet::Application::IndirectionBas
end
face = Puppet::Face::Indirector.define(:testindirection, '0.0.1') do
+ summary "fake summary"
end
# REVISIT: This horror is required because we don't allow anything to be
# :current except for if it lives on, and is loaded from, disk. --daniel 2011-03-29
diff --git a/spec/unit/face/help_spec.rb b/spec/unit/face/help_spec.rb
index e67f29e07..33e13a240 100755
--- a/spec/unit/face/help_spec.rb
+++ b/spec/unit/face/help_spec.rb
@@ -46,6 +46,12 @@ describe Puppet::Face[:help, '0.0.1'] do
context "when listing subcommands" do
subject { Puppet::Face[:help, :current].help }
+ RSpec::Matchers.define :have_a_summary do
+ match do |instance|
+ instance.summary.is_a?(String)
+ end
+ end
+
# Check a precondition for the next block; if this fails you have
# something odd in your set of face, and we skip testing things that
# matter. --daniel 2011-04-10
@@ -59,8 +65,13 @@ describe Puppet::Face[:help, '0.0.1'] do
face = Puppet::Face[name, :current]
summary = face.summary
- it { should =~ %r{ #{name} } }
- it { should =~ %r{ #{name} +#{summary}} } if summary
+ it "should list the '#{name}' face in the general help" do
+ should =~ %r{ #{name} }
+ end
+
+ it "should have a summary for #{name}" do
+ face.should have_a_summary
+ end
end
Puppet::Face[:help, :current].legacy_applications.each do |appname|