summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rwxr-xr-xspec/unit/file_bucket/dipper.rb12
-rwxr-xr-xspec/unit/indirector/file_bucket_file/file.rb11
2 files changed, 12 insertions, 11 deletions
diff --git a/spec/unit/file_bucket/dipper.rb b/spec/unit/file_bucket/dipper.rb
index 5ada34e9d..06ed16c4d 100755
--- a/spec/unit/file_bucket/dipper.rb
+++ b/spec/unit/file_bucket/dipper.rb
@@ -57,9 +57,9 @@ describe Puppet::FileBucket::Dipper do
bucketfile = stub "bucketfile"
bucketfile.stubs(:to_s).returns "Content"
- Puppet::FileBucket::File.expects(:find).with(
- 'md5/DIGEST123'
- ).returns(bucketfile)
+ Puppet::FileBucket::File.expects(:find).with{|x,opts|
+ x == 'md5/DIGEST123'
+ }.returns(bucketfile)
@dipper.getfile("DIGEST123").should == "Content"
end
@@ -99,9 +99,9 @@ describe Puppet::FileBucket::Dipper do
bucketfile = stub "bucketfile"
bucketfile.stubs(:to_s).returns "Content"
- Puppet::FileBucket::File.expects(:find).with(
- 'https://puppetmaster:31337/production/file_bucket_file/md5/DIGEST123'
- ).returns(bucketfile)
+ Puppet::FileBucket::File.expects(:find).with{|x,opts|
+ x == 'https://puppetmaster:31337/production/file_bucket_file/md5/DIGEST123'
+ }.returns(bucketfile)
@dipper.getfile("DIGEST123").should == "Content"
end
diff --git a/spec/unit/indirector/file_bucket_file/file.rb b/spec/unit/indirector/file_bucket_file/file.rb
index 0df530d74..6e0d340f3 100755
--- a/spec/unit/indirector/file_bucket_file/file.rb
+++ b/spec/unit/indirector/file_bucket_file/file.rb
@@ -36,7 +36,7 @@ describe Puppet::FileBucketFile::File do
it "should return nil if a file doesn't exist" do
::File.expects(:exist?).with("#{@dir}/contents").returns false
- bucketfile = Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}")
+ bucketfile = Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}", {})
bucketfile.should == nil
end
@@ -45,7 +45,7 @@ describe Puppet::FileBucketFile::File do
::File.expects(:exist?).with("#{@dir}/paths").returns false
::File.expects(:read).with("#{@dir}/contents").returns @contents
- bucketfile = Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}")
+ bucketfile = Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}", {})
bucketfile.should_not == nil
end
@@ -59,7 +59,7 @@ describe Puppet::FileBucketFile::File do
mockfile.expects(:readlines).returns( paths )
::File.expects(:open).with("#{@dir}/paths").yields mockfile
- Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}").paths.should == paths
+ Puppet::FileBucketFile::File.new.send(:find_by_checksum, "md5:#{@digest}", {}).paths.should == paths
end
end
@@ -79,11 +79,11 @@ describe Puppet::FileBucketFile::File do
@contents_path = '/what/ever/7/0/9/2/4/d/6/f/70924d6fa4b2d745185fa4660703a5c0/contents'
@paths_path = '/what/ever/7/0/9/2/4/d/6/f/70924d6fa4b2d745185fa4660703a5c0/paths'
- @request = stub 'request', :key => "md5/#{@digest}/remote/path"
+ @request = stub 'request', :key => "md5/#{@digest}/remote/path", :options => {}
end
it "should call find_by_checksum" do
- @store.expects(:find_by_checksum).with("md5:#{@digest}").returns(false)
+ @store.expects(:find_by_checksum).with{|x,opts| x == "md5:#{@digest}"}.returns(false)
@store.find(@request)
end
@@ -96,6 +96,7 @@ describe Puppet::FileBucketFile::File do
content = "my content"
bucketfile = stub 'bucketfile'
bucketfile.stubs(:bucket_path)
+ bucketfile.stubs(:bucket_path=)
bucketfile.stubs(:checksum_data).returns(@digest)
bucketfile.stubs(:checksum).returns(@checksum)