summaryrefslogtreecommitdiffstats
path: root/spec/integration
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2008-08-24 14:42:48 -0500
committerLuke Kanies <luke@madstop.com>2008-08-26 22:40:41 -0700
commit8ea25efd90b4d2281db12076cbaab3f766cac8b4 (patch)
tree3dcd4eedbb8c3a7118927fa2581375975cfdbc22 /spec/integration
parent550e3d6ad5aadfe99fc1e10efa77cc193d3a9df3 (diff)
downloadpuppet-8ea25efd90b4d2281db12076cbaab3f766cac8b4.tar.gz
puppet-8ea25efd90b4d2281db12076cbaab3f766cac8b4.tar.xz
puppet-8ea25efd90b4d2281db12076cbaab3f766cac8b4.zip
Refactoring how files in FileServing are named.
Previously, they retained some concept of the URI used to find them, and this uri was the primary key for the FileServing instances. This key was unfortunately completely useless, as evidenced by the fact that it was never used except to test that it worked. I've modified the FileServing instances (through modifying the Base class) to use their local path as their key, and they no longer care about the URI at all. This commit is mostly about fixing the code that interacts with the instances to use this new API. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/integration')
-rwxr-xr-xspec/integration/file_serving/metadata.rb2
-rwxr-xr-xspec/integration/indirector/direct_file_server.rb4
-rwxr-xr-xspec/integration/indirector/module_files.rb4
3 files changed, 6 insertions, 4 deletions
diff --git a/spec/integration/file_serving/metadata.rb b/spec/integration/file_serving/metadata.rb
index 067cb566a..af3e16324 100755
--- a/spec/integration/file_serving/metadata.rb
+++ b/spec/integration/file_serving/metadata.rb
@@ -15,4 +15,6 @@ describe Puppet::FileServing::Metadata, " when finding files" do
@test_class = Puppet::FileServing::Metadata
@indirection = Puppet::FileServing::Metadata.indirection
end
+
+ after { Puppet::Util::Cacher.invalidate }
end
diff --git a/spec/integration/indirector/direct_file_server.rb b/spec/integration/indirector/direct_file_server.rb
index 40b753a6c..6f3da5169 100755
--- a/spec/integration/indirector/direct_file_server.rb
+++ b/spec/integration/indirector/direct_file_server.rb
@@ -68,12 +68,12 @@ describe Puppet::Indirector::DirectFileServer, " when interacting with FileServi
end
@terminus.search(@request).each do |instance|
- case instance.key
+ case instance.full_path
when /one/: instance.content.should == "one content"
when /two/: instance.content.should == "two content"
when /\.$/:
else
- raise "No valid key for %s" % instance.key.inspect
+ raise "No valid key for %s" % instance.path.inspect
end
end
end
diff --git a/spec/integration/indirector/module_files.rb b/spec/integration/indirector/module_files.rb
index ae14aa5a7..6cbbd3dbd 100755
--- a/spec/integration/indirector/module_files.rb
+++ b/spec/integration/indirector/module_files.rb
@@ -20,7 +20,7 @@ describe Puppet::Indirector::ModuleFiles, " when interacting with Puppet::Module
FileTest.expects(:exists?).with(filepath).returns(true)
- @request = Puppet::Indirector::Request.new(:content, :find, "puppetmounts://host/modules/mymod/myfile")
+ @request = Puppet::Indirector::Request.new(:content, :find, "puppet://host/modules/mymod/myfile")
@terminus.find(@request).should be_instance_of(Puppet::FileServing::Content)
end
@@ -47,7 +47,7 @@ describe Puppet::Indirector::ModuleFiles, " when interacting with FileServing::F
Dir.expects(:entries).with(filepath).returns(%w{one two})
- @request = Puppet::Indirector::Request.new(:content, :search, "puppetmounts://host/modules/mymod/myfile", :recurse => true)
+ @request = Puppet::Indirector::Request.new(:content, :search, "puppet://host/modules/mymod/myfile", :recurse => true)
result = @terminus.search(@request)
result.should be_instance_of(Array)