summaryrefslogtreecommitdiffstats
path: root/spec/unit
diff options
context:
space:
mode:
authorDaniel Pittman <daniel@puppetlabs.com>2011-04-10 19:58:43 -0700
committerDaniel Pittman <daniel@puppetlabs.com>2011-04-12 16:12:08 -0700
commit4eccd53da90593fad1b929eeea3b5d7d252c553e (patch)
tree14a7f80fe98b554bd7599b8cb84b05089747bf96 /spec/unit
parent1b4d7a51d10b217c7f67f3876242fff6dc694faa (diff)
downloadpuppet-4eccd53da90593fad1b929eeea3b5d7d252c553e.tar.gz
puppet-4eccd53da90593fad1b929eeea3b5d7d252c553e.tar.xz
puppet-4eccd53da90593fad1b929eeea3b5d7d252c553e.zip
(#6962) Implement Face#summary support for the help face.
We now use the summary information available in other faces as part of emitting a list our list of available subcommands. This is seldom used in faces, but enough emit the information to prove the concept. Reviewed-By: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'spec/unit')
-rw-r--r--spec/unit/faces/help_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/unit/faces/help_spec.rb b/spec/unit/faces/help_spec.rb
index 5b611a0ad..ad553dc3a 100644
--- a/spec/unit/faces/help_spec.rb
+++ b/spec/unit/faces/help_spec.rb
@@ -41,4 +41,25 @@ describe Puppet::Faces[:help, '0.0.1'] do
face = Puppet::Faces[:huzzah, :current]
subject.help(:huzzah, face.version).should == subject.help(:huzzah, :current)
end
+
+ context "when listing subcommands" do
+ subject { Puppet::Faces[:help, :current].help }
+
+ # Check a precondition for the next block; if this fails you have
+ # something odd in your set of faces, and we skip testing things that
+ # matter. --daniel 2011-04-10
+ it "should have at least one face with a summary" do
+ Puppet::Faces.faces.should be_any do |name|
+ Puppet::Faces[name, :current].summary
+ end
+ end
+
+ Puppet::Faces.faces.each do |name|
+ face = Puppet::Faces[name, :current]
+ summary = face.summary
+
+ it { should have_matching_element %r{ #{name} } }
+ it { should have_matching_element %r{ #{name} +#{summary}} } if summary
+ end
+ end
end