[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5

Daniel Pittman daniel at puppetlabs.com
Tue May 10 08:10:26 UTC 2011


The following commit has been merged in the experimental branch:
commit 0e834afaa191c0a314e730416e34f44b10efda96
Author: Daniel Pittman <daniel at puppetlabs.com>
Date:   Fri Apr 1 11:29:40 2011 -0700

    MAINT: fix up tests that depend on the LoadError message to work.
    
    We depend on require throwing about a specific file on disk, rather than just
    generically, to ensure that we don't consume load errors from existing files.
    
    This means our tests need to be updated to reflect that, by raising with
    appropriate text when they stub require.
    
    Reviewed-By: Pieter van de Bruggen <pieter at puppetlabs.com>

diff --git a/spec/unit/string/string_collection_spec.rb b/spec/unit/string/string_collection_spec.rb
index 63ddf7c..184299e 100755
--- a/spec/unit/string/string_collection_spec.rb
+++ b/spec/unit/string/string_collection_spec.rb
@@ -101,7 +101,8 @@ describe Puppet::String::StringCollection do
     end
 
     it "should require the string by version if the 'current' version isn't it" do
-      subject.expects(:require).with('puppet/string/bar').raises(LoadError)
+      subject.expects(:require).with('puppet/string/bar').
+        raises(LoadError, 'no such file to load -- puppet/string/bar')
       subject.expects(:require).with do |file|
         @strings[:bar]['0.0.1'] = true
         file == 'bar at 0.0.1/puppet/string/bar'
@@ -115,7 +116,9 @@ describe Puppet::String::StringCollection do
     end
 
     it "should return false if there is a LoadError requiring the string" do
-      subject.stubs(:require).raises(LoadError)
+      subject.stubs(:require).
+        raises(LoadError, 'no such file to load -- puppet/string/bar').then.
+        raises(LoadError, 'no such file to load -- bar at 0.0.1/puppet/string/bar')
       subject.string?("bar", '0.0.1').should == false
     end
 
@@ -138,7 +141,8 @@ describe Puppet::String::StringCollection do
     end
 
     it "should not register the version loaded from `{name}@{version}` as `:current`" do
-      subject.expects(:require).with('puppet/string/huzzah').raises(LoadError)
+      subject.expects(:require).with('puppet/string/huzzah').
+        raises(LoadError, 'no such file to load -- puppet/string/huzzah')
       subject.expects(:require).with do |file|
         @strings[:huzzah]['0.0.1'] = true
         file == 'huzzah at 0.0.1/puppet/string/huzzah'

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list