diff options
Diffstat (limited to 'spec/unit')
| -rwxr-xr-x | spec/unit/application/indirection_base_spec.rb | 1 | ||||
| -rwxr-xr-x | spec/unit/face/help_spec.rb | 15 |
2 files changed, 14 insertions, 2 deletions
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| |
