From ff08ba2abc8a59caa2bae0cde0a84ded99337e1c Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 14 Apr 2011 16:48:40 -0700 Subject: (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 --- spec/unit/face/help_spec.rb | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'spec/unit/face') 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| -- cgit