diff options
| author | Luke Kanies <luke@madstop.com> | 2009-08-18 15:58:38 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-08-18 15:58:38 -0700 |
| commit | 796ba5c4ccec117bbc4dec69c670337e70b48634 (patch) | |
| tree | 549f59c2202da84a3c0d527f4df964bc61c1b6b4 /spec/integration/indirector/file_content | |
| parent | 6bd3627d606cde4bea9293b855be0dd2b1170a92 (diff) | |
| download | puppet-796ba5c4ccec117bbc4dec69c670337e70b48634.tar.gz puppet-796ba5c4ccec117bbc4dec69c670337e70b48634.tar.xz puppet-796ba5c4ccec117bbc4dec69c670337e70b48634.zip | |
Fixing #1544 - plugins in modules now works again
We had to fix the fileserving plumbing to use the request
environment instead of trying to use the node environment.
This was apparently never fixed after we added the environment
to the URI in REST calls.
There's still a bit of refactoring left to clean up the APIs used
in some of this code.
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration/indirector/file_content')
| -rwxr-xr-x | spec/integration/indirector/file_content/file_server.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/integration/indirector/file_content/file_server.rb b/spec/integration/indirector/file_content/file_server.rb index 965bd8fd1..b3c63fc33 100755 --- a/spec/integration/indirector/file_content/file_server.rb +++ b/spec/integration/indirector/file_content/file_server.rb @@ -8,11 +8,36 @@ require File.dirname(__FILE__) + '/../../../spec_helper' require 'puppet/indirector/file_content/file_server' require 'shared_behaviours/file_server_terminus' +require 'puppet_spec/files' + describe Puppet::Indirector::FileContent::FileServer, " when finding files" do it_should_behave_like "Puppet::Indirector::FileServerTerminus" + include PuppetSpec::Files before do @terminus = Puppet::Indirector::FileContent::FileServer.new @test_class = Puppet::FileServing::Content end + + it "should find file content in the environment specified in the request" do + path = tmpfile("file_content_with_env") + + Dir.mkdir(path) + + modpath = File.join(path, "mod") + FileUtils.mkdir_p(File.join(modpath, "lib")) + file = File.join(modpath, "lib", "file.rb") + File.open(file, "w") { |f| f.puts "1" } + + env = Puppet::Node::Environment.new("foo") + env.stubs(:modulepath).returns [path] + Puppet.settings[:modulepath] = "/no/such/file" + + result = Puppet::FileServing::Content.search("plugins", :environment => "foo", :recurse => true) + + result.should_not be_nil + result.length.should == 2 + result[1].should be_instance_of(Puppet::FileServing::Content) + result[1].content.should == "1\n" + end end |
