spec/unit/network/handler/fileserver.rb in puppet-0.24.9 vs spec/unit/network/handler/fileserver.rb in puppet-0.25.0
- old
+ new
@@ -144,24 +144,21 @@
create_file(File.join(facter,"fact.rb"))
end
before :each do
@modules = ["one","two"]
- Puppet::Module.stubs(:all).returns(@modules.collect{ |p| File.join(@basedir,p)} )
@modules.each { |m| create_plugin(m, "facter") }
- @modules.each do |p|
- File.stubs(:directory?).with(File.join(@basedir,p,PLUGINS)).returns(true)
- end
+ Puppet::Node::Environment.new.stubs(:modulepath).returns @basedir
@mount = Puppet::Network::Handler::FileServer::PluginMount.new(PLUGINS)
@mount.allow("*")
end
it "should list a file within a directory when given the file path with recursion" do
@mount.list("facter/fact.rb", true, "false").should == [["/", "file"], ["/", "file"]]
end
-
+
it "should return a merged view of all plugins for all modules" do
list = @mount.list("facter",true,false)
list.should == [["/", "directory"], ["/fact.rb", "file"], ["/", "directory"], ["/fact.rb", "file"]]
end