From 174e02a2b71fd51ff27f9186526352d79253da26 Mon Sep 17 00:00:00 2001 From: Matt Robinson Date: Thu, 1 Jul 2010 12:01:46 -0700 Subject: [#4090] Change how RunMode instances are created so that an object for each RunMode is only created once instead of every time it's called Got lots of unpredictable test failures, presumably because a new RunMode was being created every time we accessed the RunMode. --- test/network/authorization.rb | 2 +- test/network/server/webrick.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/network/authorization.rb b/test/network/authorization.rb index 56c537773..3c1f71e49 100755 --- a/test/network/authorization.rb +++ b/test/network/authorization.rb @@ -83,7 +83,7 @@ class TestAuthConfig < Test::Unit::TestCase assert_logged(:notice, /Denying/, "did not log call") # Now set our run_mode to master, so calls are allowed - Puppet::Util::RunMode.any_instance.stubs(:master?).returns true + Puppet.run_mode.stubs(:master?).returns true assert(@obj.authorized?(@request), "Denied call with no config file and master") assert_logged(:debug, /Allowing/, "did not log call") diff --git a/test/network/server/webrick.rb b/test/network/server/webrick.rb index 99b04817c..e2493b424 100755 --- a/test/network/server/webrick.rb +++ b/test/network/server/webrick.rb @@ -93,7 +93,7 @@ class TestWebrickServer < Test::Unit::TestCase } pid = fork { - Puppet::Util::RunMode.any_instance.stubs(:master?).returns true + Puppet.run_mode.stubs(:master?).returns true assert_nothing_raised() { trap(:INT) { server.shutdown } server.start -- cgit