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

test branch puppet-dev at googlegroups.com
Wed Jul 14 10:30:23 UTC 2010


The following commit has been merged in the upstream branch:
commit 6a148e2e979237434494094ec0be86dba9556f8d
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