[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.5-639-g8f94f35

Jesse Wolfe jes5199 at gmail.com
Wed Jul 14 10:32:22 UTC 2010


The following commit has been merged in the upstream branch:
commit 23adec5cf58226a01540c308dd67dfaa7a83f4e7
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Sat Apr 10 22:55:56 2010 -0700

    Fix tests that use or stub find_by_checksum, which I just changed the
    signature of.

diff --git a/spec/unit/file_bucket/dipper.rb b/spec/unit/file_bucket/dipper.rb
index 5ada34e..06ed16c 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 0df530d..6e0d340 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)
 

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list