diff options
author | Markus Roberts <Markus@reality.com> | 2009-12-17 11:31:25 -0800 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-12-18 14:34:10 +1100 |
commit | 2d88926b76e14c8aa105ad7b1480cee9132fc699 (patch) | |
tree | afa1ba1f8d9e5a743c2621c33365a91617b452e5 | |
parent | 18c5165bea26151d446ff9ae63aeee108cb210ef (diff) | |
download | puppet-2d88926b76e14c8aa105ad7b1480cee9132fc699.tar.gz puppet-2d88926b76e14c8aa105ad7b1480cee9132fc699.tar.xz puppet-2d88926b76e14c8aa105ad7b1480cee9132fc699.zip |
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 <Markus@reality.com>
-rw-r--r-- | spec/unit/other/selinux.rb | 4 |
1 files 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", |