From 2d88926b76e14c8aa105ad7b1480cee9132fc699 Mon Sep 17 00:00:00 2001 From: Markus Roberts Date: Thu, 17 Dec 2009 11:31:25 -0800 Subject: Fix for #2869 (SELinux tests failing under some load orderings) The problem was that the setup for the tests was expecting the defaultprovider for Selboolean and Selmodule to be called, rather than stubbing it. This worked as long as no other spec which initializes the providers was run before it. The fix here (stubbing rather than expecting) is minimal but not ideal; if there were some other provider for these types it could result in a test indetermenacy (different results depending on which provider) but I'm not seeing an easy way to address that. Signed-off-by: Markus Roberts --- spec/unit/other/selinux.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/unit/other/selinux.rb b/spec/unit/other/selinux.rb index 3e39afcdd..2287570e7 100644 --- a/spec/unit/other/selinux.rb +++ b/spec/unit/other/selinux.rb @@ -28,7 +28,7 @@ end describe Puppet::Type.type(:selboolean), " when manipulating booleans" do before :each do provider_class = Puppet::Type::Selboolean.provider(Puppet::Type::Selboolean.providers[0]) - Puppet::Type::Selboolean.expects(:defaultprovider).returns provider_class + Puppet::Type::Selboolean.stubs(:defaultprovider).returns provider_class @bool = Puppet::Type::Selboolean.new( :name => "foo", @@ -57,7 +57,7 @@ end describe Puppet::Type.type(:selmodule), " when checking policy modules" do before :each do provider_class = Puppet::Type::Selmodule.provider(Puppet::Type::Selmodule.providers[0]) - Puppet::Type::Selmodule.expects(:defaultprovider).returns provider_class + Puppet::Type::Selmodule.stubs(:defaultprovider).returns provider_class @module = Puppet::Type::Selmodule.new( :name => "foo", -- cgit