summaryrefslogtreecommitdiffstats
path: root/spec/unit/face
diff options
context:
space:
mode:
Diffstat (limited to 'spec/unit/face')
-rwxr-xr-xspec/unit/face/help_spec.rb15
1 files changed, 13 insertions, 2 deletions
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|