Skip to content

Instantly share code, notes, and snippets.

@pnasrat
Created May 6, 2009 06:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pnasrat/107399 to your computer and use it in GitHub Desktop.
Save pnasrat/107399 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require File.dirname(__FILE__) + '/../spec_helper'
require 'facter'
describe "Operating System fact" do
after do
Facter.clear
end
it "should default to the kernel name" do
Facter.fact(:kernel).stubs(:value).returns("Nutmeg")
Facter.fact(:operatingsystem).value.should == "Nutmeg"
end
it "should identify Oracle VM as OVS" do
Facter.fact(:kernel).stubs(:value).returns("Linux")
FileTest.expects(:exists).with("/etc/ovs-release").returns true
FileTest.expects(:exists).with("/etc/enterprise-release").returns true
Facter.fact(:operatingsystem).value.should == "OVS"
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment