[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, upstream, updated. 0.25.4-89-gcbbd363

James Turnbull james at lovedthanlost.net
Tue May 18 09:04:10 UTC 2010


The following commit has been merged in the upstream branch:
commit 5ab5e8a00648569686c5259862c865c5db8da83a
Author: Jesse Wolfe <jes5199 at gmail.com>
Date:   Tue Mar 23 22:09:14 2010 -0700

    Supressing warnings (not really failures) in test/unit

diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index a6c6786..f17d82b 100755
--- a/test/network/handler/fileserver.rb
+++ b/test/network/handler/fileserver.rb
@@ -947,12 +947,16 @@ allow *
          end
 
         # Now, check that they use Facter info
-        Puppet.notice "The following messages are normal"
         client = nil
-        Facter.stubs(:value).with(:ipaddress).returns("127.0.0.1")
         Facter.stubs(:value).with { |v| v.to_s == "hostname" }.returns("myhost")
         Facter.stubs(:value).with { |v| v.to_s == "domain" }.returns("mydomain.com")
-        Facter.stubs(:value).with(:domain).returns("mydomain.com")
+
+        Facter.stubs(:to_hash).returns({
+            :ipaddress => "127.0.0.1",
+            :hostname => "myhost",
+            :domain   => "mydomain.com",
+        })
+
 
         {"%h" => "myhost", # Short name
          "%H" => "myhost.mydomain.com", # Full name
@@ -979,13 +983,15 @@ allow *
 
         # When mocks attack, part 2
         kernel_fact = Facter.value(:kernel)
-        Facter.stubs(:value).with(:kernel).returns(kernel_fact)
 
-        Facter.stubs(:value).with(:ipaddress).returns("127.0.0.1")
-        Facter.stubs(:value).with { |v| v.to_s == "hostname" }.returns("myhost")
-        Facter.stubs(:value).with { |v| v.to_s == "domain" }.returns("mydomain.com")
-        Facter.stubs(:value).with(:domain).returns("mydomain.com")
-        ip = Facter.value(:ipaddress)
+        ip = '127.0.0.1'
+
+        Facter.stubs(:to_hash).returns({
+            :kernel => kernel_fact,
+            :ipaddress => "127.0.0.1",
+            :hostname => "myhost",
+            :domain   => "mydomain.com",
+        })
 
         Dir.mkdir(dir)
         host = "myhost.mydomain.com"
diff --git a/test/ral/providers/package.rb b/test/ral/providers/package.rb
index e7f9300..4435188 100755
--- a/test/ral/providers/package.rb
+++ b/test/ral/providers/package.rb
@@ -238,6 +238,10 @@ class TestPackageProvider < Test::Unit::TestCase
         end
     end
 
+    def test_dont_complain_if_theres_nothing_to_test
+        assert("sometimes the above metaprogramming fails to find anything to test and the runner complains")
+    end
+
     def modpkg(pkg)
         case pkg[:provider]
         when :sun

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list