summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Parker <andy@puppetlabs.com>2014-10-13 13:25:30 -0700
committerAndrew Parker <andy@puppetlabs.com>2014-10-13 13:25:30 -0700
commitd839e1d3abbc5048816d669154a05a274d01ffc4 (patch)
tree4c5b815c70962d77580bd17a93f3a8528edeefa3
parent9b46778119ab697a0e631d48f674f86929dfc1bb (diff)
downloadpuppet-d839e1d3abbc5048816d669154a05a274d01ffc4.tar.gz
(maint) Separate test for missing module directory
The test of behavior when a module directory is specified as part of an environment but is missing on disk was hidden inside another test. This splits it out and calls out that the behavior is that the directory is simply ignored.
-rwxr-xr-xspec/unit/util/autoload_spec.rb9
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/unit/util/autoload_spec.rb b/spec/unit/util/autoload_spec.rb
index 0e32dbf84..d24006360 100755
--- a/spec/unit/util/autoload_spec.rb
+++ b/spec/unit/util/autoload_spec.rb
@@ -9,7 +9,6 @@ describe Puppet::Util::Autoload do
before do
@autoload = Puppet::Util::Autoload.new("foo", "tmp")
- @autoload.stubs(:eachdir).yields make_absolute("/my/dir")
@loaded = {}
@autoload.class.stubs(:loaded).returns(@loaded)
end
@@ -31,11 +30,17 @@ describe Puppet::Util::Autoload do
"two" => { "lib" => {} }
})
- environment = Puppet::Node::Environment.create(:foo, [dira, dirb, File.expand_path('does/not/exist')])
+ environment = Puppet::Node::Environment.create(:foo, [dira, dirb])
@autoload.class.module_directories(environment).should == ["#{dira}/two/lib", "#{dirb}/two/lib"]
end
+ it "ignores missing module directories" do
+ environment = Puppet::Node::Environment.create(:foo, [File.expand_path('does/not/exist')])
+
+ @autoload.class.module_directories(environment).should be_empty
+ end
+
it "ignores the configured environment when it doesn't exist" do
Puppet[:environment] = 'nonexistent'