summaryrefslogtreecommitdiffstats
path: root/test/network/handler
diff options
context:
space:
mode:
authorJesse Wolfe <jes5199@gmail.com>2010-03-23 22:09:14 -0700
committerJames Turnbull <james@lovedthanlost.net>2010-03-26 12:16:45 +1100
commit5ab5e8a00648569686c5259862c865c5db8da83a (patch)
treebf7f68513c85adf37679bb6a9ce21a2dc22148d9 /test/network/handler
parente4df0b0559050fcaf963e2ee72135e8e25712583 (diff)
downloadpuppet-5ab5e8a00648569686c5259862c865c5db8da83a.tar.gz
puppet-5ab5e8a00648569686c5259862c865c5db8da83a.tar.xz
puppet-5ab5e8a00648569686c5259862c865c5db8da83a.zip
Supressing warnings (not really failures) in test/unit
Diffstat (limited to 'test/network/handler')
-rwxr-xr-xtest/network/handler/fileserver.rb24
1 files changed, 15 insertions, 9 deletions
diff --git a/test/network/handler/fileserver.rb b/test/network/handler/fileserver.rb
index a6c678683..f17d82bf6 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"