~nvalcarcel/ubuntu/lucid/puppet/fix-546677

« back to all changes in this revision

Viewing changes to spec/unit/util/checksums.rb

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2009-12-23 00:48:10 UTC
  • mfrom: (1.1.10 upstream) (3.1.7 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091223004810-3i4oryds922g5n59
Tags: 0.25.1-3ubuntu1
* Merge from debian testing.  Remaining changes:
  - debian/rules:
    + Don't start puppet when first installing puppet.
  - debian/puppet.conf, lib/puppet/defaults.rb:
    + Move templates to /etc/puppet
  - lib/puppet/defaults.rb:
    + Fix /var/lib/puppet/state ownership.
  - man/man8/puppet.conf.8: 
    + Fix broken URL in manpage.
  - debian/control:
    + Update maintainer accordint to spec.
    + Puppetmaster Recommends -> Suggests
    + Created puppet-testsuite as a seperate. Allow the users to run puppet's 
      testsuite.
  - tests/Rakefile: Fix rakefile so that the testsuite can acutally be ran.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
        end
29
29
    end
30
30
 
 
31
    it "should have a method for stripping a sum type from an existing checksum" do
 
32
        @summer.sumtype("{md5}asdfasdfa").should == "md5"
 
33
    end
 
34
 
 
35
    it "should return a nil sumtype if the checksum does not mention a checksum type" do
 
36
        @summer.sumtype("asdfasdfa").should be_nil
 
37
    end
 
38
 
31
39
    {:md5 => Digest::MD5, :sha1 => Digest::SHA1}.each do |sum, klass|
32
40
        describe("when using %s" % sum) do
33
41
            it "should use #{klass} to calculate string checksums" do
42
50
                file = "/path/to/my/file"
43
51
 
44
52
                fh = mock 'filehandle'
45
 
                fh.expects(:read).with(512).times(3).returns("firstline").then.returns("secondline").then.returns(nil)
 
53
                fh.expects(:read).with(4096).times(3).returns("firstline").then.returns("secondline").then.returns(nil)
46
54
                #fh.expects(:read).with(512).returns("secondline")
47
55
                #fh.expects(:read).with(512).returns(nil)
48
56