diff options
Diffstat (limited to 'spec/unit/virtual.rb')
-rw-r--r-- | spec/unit/virtual.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/virtual.rb b/spec/unit/virtual.rb index 7dbd146..8ee843b 100644 --- a/spec/unit/virtual.rb +++ b/spec/unit/virtual.rb @@ -17,6 +17,13 @@ describe "Virtual fact" do Facter.fact(:virtual).value.should == "zone" end + it "should be jail on FreeBSD when a jail in kvm" do + Facter.fact(:kernel).stubs(:value).returns("FreeBSD") + Facter::Util::Virtual.stubs(:jail?).returns(true) + Facter::Util::Virtual.stubs(:kvm?).returns(true) + Facter.fact(:virtual).value.should == "jail" + end + end describe "is_virtual fact" do @@ -55,4 +62,10 @@ describe "is_virtual fact" do Facter.fact(:is_virtual).value.should == true end + it "should be true when running in jail" do + Facter.fact(:kernel).stubs(:value).returns("FreeBSD") + Facter.fact(:virtual).stubs(:value).returns("jail") + Facter.fact(:is_virtual).value.should == true + end + end |