diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-18 15:25:19 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-19 10:53:10 -0700 |
| commit | 22355dc01a7cab82427b43987f2bf542c281305c (patch) | |
| tree | b9e13fc179aca14e5802f6ca893688f0ead3939d | |
| parent | 5a100937d70d3a151153b958f92f3907d4547cd2 (diff) | |
| download | puppet-22355dc01a7cab82427b43987f2bf542c281305c.tar.gz puppet-22355dc01a7cab82427b43987f2bf542c281305c.tar.xz puppet-22355dc01a7cab82427b43987f2bf542c281305c.zip | |
maint: test the 'help' face has the default action 'help'
We had a pending test for this, but forgot to write it way back when we were
implementing the feature. Add it now.
Reviewed-By: Max Martin <max@puppetlabs.com>
| -rw-r--r-- | lib/puppet/interface/action.rb | 7 | ||||
| -rwxr-xr-x | spec/unit/face/help_spec.rb | 2 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/puppet/interface/action.rb b/lib/puppet/interface/action.rb index 412e39449..efe7b1f50 100644 --- a/lib/puppet/interface/action.rb +++ b/lib/puppet/interface/action.rb @@ -24,7 +24,12 @@ class Puppet::Interface::Action attr_reader :name def to_s() "#{@face}##{@name}" end - attr_accessor :default, :summary + attr_accessor :default + def default? + !!@default + end + + attr_accessor :summary # Initially, this was defined to allow the @action.invoke pattern, which is # a very natural way to invoke behaviour given our introspection diff --git a/spec/unit/face/help_spec.rb b/spec/unit/face/help_spec.rb index b5205afd6..faa5f9617 100755 --- a/spec/unit/face/help_spec.rb +++ b/spec/unit/face/help_spec.rb @@ -7,7 +7,7 @@ describe Puppet::Face[:help, '0.0.1'] do end it "should have a default action of help" do - pending "REVISIT: we don't support default actions yet" + subject.get_action('help').should be_default end it "should accept a call with no arguments" do |
