diff options
| author | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-11 10:57:06 -0700 |
|---|---|---|
| committer | Daniel Pittman <daniel@puppetlabs.com> | 2011-04-12 16:12:08 -0700 |
| commit | 14b1e008c1368e6c56d68f83999472351fd3327a (patch) | |
| tree | da1ca0f7c0dfc3d1bdf55adba0b9393f1caf8fe3 /spec/unit/util | |
| parent | 4eccd53da90593fad1b929eeea3b5d7d252c553e (diff) | |
| download | puppet-14b1e008c1368e6c56d68f83999472351fd3327a.tar.gz puppet-14b1e008c1368e6c56d68f83999472351fd3327a.tar.xz puppet-14b1e008c1368e6c56d68f83999472351fd3327a.zip | |
(#6992) Expose available_subcommands as a class method.
We previously treated the list of legacy commands as an instance property of
Puppet::Util::CommandLine. This made it difficult to obtain that information
outside the context of the instantiated application.
In the longer term this should wither and die as we eliminate the legacy
applications entirely, but until then exposing that on the class is the
lightest mechanism for making that useful.
Paired-With: Matt Robinson <matt@puppetlabs.com>
Diffstat (limited to 'spec/unit/util')
| -rwxr-xr-x | spec/unit/util/command_line_spec.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/spec/unit/util/command_line_spec.rb b/spec/unit/util/command_line_spec.rb index ca5f0540f..c5c6e5f3e 100755 --- a/spec/unit/util/command_line_spec.rb +++ b/spec/unit/util/command_line_spec.rb @@ -111,6 +111,11 @@ describe Puppet::Util::CommandLine do @core_apps = %w{describe filebucket kick queue resource agent cert apply doc master} @command_line = Puppet::Util::CommandLine.new("foo", %w{ client --help whatever.pp }, @tty ) end + it "should expose available_subcommands as a class method" do + @core_apps.each do |command| + @command_line.available_subcommands.should include command + end + end it 'should be able to find all existing commands' do @core_apps.each do |command| @command_line.available_subcommands.should include command |
