summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJacob Helwig <jacob@puppetlabs.com>2011-02-01 17:07:58 -0800
committerJacob Helwig <jacob@puppetlabs.com>2011-02-01 17:07:58 -0800
commit526335cff0f47c1efc25ffda535e2ead10f10fac (patch)
tree46005b303e7f697b85725d9e9a61735db42287a3 /spec
parentc677f5bd4bb18ec93b82d8f39f317dd40963c2cc (diff)
parentc1b5c7f515a0add663fb532859d91e28ef37a971 (diff)
downloadpuppet-526335cff0f47c1efc25ffda535e2ead10f10fac.tar.gz
puppet-526335cff0f47c1efc25ffda535e2ead10f10fac.tar.xz
puppet-526335cff0f47c1efc25ffda535e2ead10f10fac.zip
Merge branch 'ticket/2.6.x/5913' of git://github.com/mitchellh/puppet into 2.6.next
* 'ticket/2.6.x/5913' of git://github.com/mitchellh/puppet: (#5913) Fix Puppet::Application.find constant lookup behavior
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/application_spec.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/spec/unit/application_spec.rb b/spec/unit/application_spec.rb
index f68a7e209..c0f97336c 100755
--- a/spec/unit/application_spec.rb
+++ b/spec/unit/application_spec.rb
@@ -16,6 +16,25 @@ describe Puppet::Application do
Puppet.settings.stubs(:parse)
end
+ describe "finding" do
+ before do
+ @klass = Puppet::Application
+ @klass.stubs(:puts)
+ end
+
+ it "should find classes in the namespace" do
+ @klass.find("Agent").should == @klass::Agent
+ end
+
+ it "should not find classes outside the namespace" do
+ lambda { @klass.find("String") }.should raise_error(SystemExit)
+ end
+
+ it "should exit if it can't find a class" do
+ lambda { @klass.find("ThisShallNeverEverEverExistAsdf") }.should raise_error(SystemExit)
+ end
+ end
+
describe ".run_mode" do
it "should default to user" do
@appclass.run_mode.name.should == :user