diff options
author | Luke Kanies <luke@madstop.com> | 2009-02-18 12:16:39 -0600 |
---|---|---|
committer | Luke Kanies <luke@madstop.com> | 2009-02-19 16:22:49 -0600 |
commit | 058266feebb3be90f6af29d0ff70b22ceeb9b3e7 (patch) | |
tree | 05a49a8f69d66d4b2432fea1f2c77a88743ab94e /spec/integration | |
parent | 19b85346a60a05fd146fe39742cb873490eb6b4c (diff) | |
download | puppet-058266feebb3be90f6af29d0ff70b22ceeb9b3e7.tar.gz puppet-058266feebb3be90f6af29d0ff70b22ceeb9b3e7.tar.xz puppet-058266feebb3be90f6af29d0ff70b22ceeb9b3e7.zip |
Switching the ModuleFiles Indirection terminus to the new Module/Env api
Again, much cleaner and simpler.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration')
-rwxr-xr-x | spec/integration/indirector/module_files.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/spec/integration/indirector/module_files.rb b/spec/integration/indirector/module_files.rb index a474b7513..0eb1c9964 100755 --- a/spec/integration/indirector/module_files.rb +++ b/spec/integration/indirector/module_files.rb @@ -10,11 +10,13 @@ require 'puppet/indirector/module_files' describe Puppet::Indirector::ModuleFiles, " when interacting with Puppet::Module and FileServing::Content" do it "should look for files in the module's 'files' directory" do - Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv")) + @environment = stub('env', :name => "myenv") + Puppet::Node::Environment.stubs(:new).returns(@environment) # We just test a subclass, since it's close enough. @terminus = Puppet::Indirector::FileContent::Modules.new @module = Puppet::Module.new("mymod", "/some/path/mymod") - Puppet::Module.expects(:find).with("mymod", "myenv").returns(@module) + + @environment.expects(:module).with("mymod").returns @module filepath = "/some/path/mymod/files/myfile" @@ -28,7 +30,8 @@ end describe Puppet::Indirector::ModuleFiles, " when interacting with FileServing::Fileset and FileServing::Content" do it "should return an instance for every file in the fileset" do - Puppet::Node::Environment.stubs(:new).returns(stub('env', :name => "myenv")) + @environment = stub('env', :name => "myenv") + Puppet::Node::Environment.stubs(:new).returns @environment @terminus = Puppet::Indirector::FileContent::Modules.new @path = Tempfile.new("module_file_testing") @@ -46,7 +49,7 @@ describe Puppet::Indirector::ModuleFiles, " when interacting with FileServing::F File.open(File.join(basedir, "two"), "w") { |f| f.print "two content" } @module = Puppet::Module.new("mymod", @path) - Puppet::Module.expects(:find).with("mymod", "myenv").returns(@module) + @environment.expects(:module).with("mymod").returns @module @request = Puppet::Indirector::Request.new(:content, :search, "puppet://host/modules/mymod/myfile", :recurse => true) |