diff options
| author | James Turnbull <james@lovedthanlost.net> | 2011-03-07 10:43:33 +1100 |
|---|---|---|
| committer | James Turnbull <james@lovedthanlost.net> | 2011-03-07 10:43:33 +1100 |
| commit | 49febe4fb55f35bff84dddc586e71fa0a74bc48b (patch) | |
| tree | 711027b00df5fc4691a9075366a0402a48416ff6 | |
| parent | 86ee6b3d55fb5f3c99bf9c0b5ee1c6013e9a1aa1 (diff) | |
| parent | d6ce08a4d7c7e0a7396cc2eacd32d18d9c95542d (diff) | |
Merge branch 'tickets/master/6611'
| -rw-r--r-- | spec/unit/virtual_spec.rb | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/spec/unit/virtual_spec.rb b/spec/unit/virtual_spec.rb index a152b40..5f63dab 100644 --- a/spec/unit/virtual_spec.rb +++ b/spec/unit/virtual_spec.rb @@ -6,9 +6,14 @@ require 'facter/util/macosx' describe "Virtual fact" do - after do - Facter.clear - end + before do + Facter::Util::Virtual.stubs(:zone?).returns(false) + Facter::Util::Virtual.stubs(:openvz?).returns(false) + Facter::Util::Virtual.stubs(:vserver?).returns(false) + Facter::Util::Virtual.stubs(:xen?).returns(false) + Facter::Util::Virtual.stubs(:kvm?).returns(false) + Facter::Util::Virtual.stubs(:hpvm?).returns(false) + end it "should be zone on Solaris when a zone" do Facter.fact(:kernel).stubs(:value).returns("SunOS") @@ -58,13 +63,6 @@ describe "Virtual fact" do end describe "on Linux" do - before do - Facter::Util::Virtual.stubs(:zone?).returns(false) - Facter::Util::Virtual.stubs(:openvz?).returns(false) - Facter::Util::Virtual.stubs(:vserver?).returns(false) - Facter::Util::Virtual.stubs(:xen?).returns(false) - Facter::Util::Virtual.stubs(:kvm?).returns(false) - end it "should be parallels with Parallels vendor id from lspci" do Facter.fact(:kernel).stubs(:value).returns("Linux") @@ -114,15 +112,10 @@ describe "Virtual fact" do Facter.fact(:virtual).value.should == "parallels" end end - end describe "is_virtual fact" do - after do - Facter.clear - end - it "should be virtual when running on xen" do Facter.fact(:kernel).stubs(:value).returns("Linux") Facter.fact(:virtual).stubs(:value).returns("xenu") |
