summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-04-10 22:55:56 -0700
committerJesse Wolfe <jes5199@gmail.com>2010-04-10 22:55:56 -0700
commit23adec5cf58226a01540c308dd67dfaa7a83f4e7 (patch)
treefb50cfcafa1d6c5d9baf29bc0508058a751ba454 /spec
parent4ac8e2c3b08ba20318d146647c8c6244f97fc9bc (diff)
downloadpuppet-23adec5cf58226a01540c308dd67dfaa7a83f4e7.tar.gz
puppet-23adec5cf58226a01540c308dd67dfaa7a83f4e7.tar.xz
puppet-23adec5cf58226a01540c308dd67dfaa7a83f4e7.zip
Fix tests that use or stub find_by_checksum, which I just changed the
signature of.
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)