[Pkg-puppet-devel] [facter] 26/61: (maint) Stub extraneous facts when testing ifconfig

Stig Sandbeck Mathisen ssm at debian.org
Mon Nov 4 15:01:53 UTC 2013


This is an automated email from the git hooks/post-receive script.

ssm pushed a commit to branch master
in repository facter.

commit 56ce53a639e2f5fac102624de099ce9c13ab6de0
Author: Adrien Thebo <git at somethingsinistral.net>
Date:   Wed Jul 24 11:12:47 2013 -0700

    (maint) Stub extraneous facts when testing ifconfig
    
    If the higher weight ifconfig fact fails to resolve, Facter will try to
    determine the IP address by resolving the hostname. When testing to
    ensure that the ifconfig based resolution returns nil, the resolution
    fact will be called and return an unexpected value. This commit stubs
    the hostname fact when testing the ifconfig ipaddress resolution to
    ensure the tests behave consistently.
---
 spec/unit/ipaddress_spec.rb |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/spec/unit/ipaddress_spec.rb b/spec/unit/ipaddress_spec.rb
index 764e43a..85f9aa6 100755
--- a/spec/unit/ipaddress_spec.rb
+++ b/spec/unit/ipaddress_spec.rb
@@ -9,6 +9,10 @@ describe "ipaddress fact" do
   end
 
   context 'using `ifconfig`' do
+    before :each do
+      Facter.fact(:hostname).stubs(:value)
+    end
+
     context "on Linux" do
       before :each do
         Facter.fact(:kernel).stubs(:value).returns("Linux")

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-puppet/facter.git



More information about the Pkg-puppet-devel mailing list