diff options
author | Matt Robinson <matt@puppetlabs.com> | 2011-08-09 10:56:52 -0700 |
---|---|---|
committer | Matt Robinson <matt@puppetlabs.com> | 2011-08-09 11:45:39 -0700 |
commit | 3a19628194d8ec8319fb9090b8fb62620956c03c (patch) | |
tree | 2219cac1d0ccf70a3f3c4a2b653fd26a4326d829 /spec | |
parent | 3a17e2896b4167aa33f3bbe7a2b7aa6ed3086ae4 (diff) | |
download | puppet-3a19628194d8ec8319fb9090b8fb62620956c03c.tar.gz puppet-3a19628194d8ec8319fb9090b8fb62620956c03c.tar.xz puppet-3a19628194d8ec8319fb9090b8fb62620956c03c.zip |
maint: Fix inspect help
Running `puppet help inspect` did not result in help:
Unable to find application 'inspect'.
err: exit
err: Try 'puppet help help help' for usage
It turned out that the only reason applications were getting required so
that their help could be found was the LegacyName conversion table in
lib/puppet/util/command_line.rb:7. Inspect never had a legacy name, so
the help system couldn't find it since it never got required. Now
instead of checking for the class constant to see if the application has
been loaded, we try to require the application and exit if it's not
found.
Reviewed-by: Nick Lewis <nick@puppetlabs.com>
Diffstat (limited to 'spec')
-rwxr-xr-x | spec/unit/application_spec.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb index aed80e3e6..b56aa20b0 100755 --- a/spec/unit/application_spec.rb +++ b/spec/unit/application_spec.rb @@ -31,6 +31,10 @@ describe Puppet::Application do end it "should exit if it can't find a class" do + reg = "Unable to find application 'ThisShallNeverEverEverExist'. " + reg += "no such file to load -- puppet/application/ThisShallNeverEverEverExist" + @klass.expects(:puts).with(reg) + expect { @klass.find("ThisShallNeverEverEverExist") }.to exit_with 1 end end |