spec/unit/plugins/linux/platform_spec.rb in ohai-7.0.4 vs spec/unit/plugins/linux/platform_spec.rb in ohai-7.2.0.alpha.0

- old
+ new

@@ -26,10 +26,11 @@ @plugin.stub(:collect_os).and_return(:linux) @plugin[:lsb] = Mash.new File.stub(:exists?).with("/etc/debian_version").and_return(false) File.stub(:exists?).with("/etc/redhat-release").and_return(false) File.stub(:exists?).with("/etc/gentoo-release").and_return(false) + File.stub(:exists?).with("/etc/exherbo-release").and_return(false) File.stub(:exists?).with("/etc/SuSE-release").and_return(false) File.stub(:exists?).with("/etc/arch-release").and_return(false) File.stub(:exists?).with("/etc/system-release").and_return(false) File.stub(:exists?).with("/etc/slackware-version").and_return(false) File.stub(:exists?).with("/etc/enterprise-release").and_return(false) @@ -179,9 +180,22 @@ it "should set platform and platform_family to gentoo" do File.should_receive(:read).with("/etc/gentoo-release").and_return("Gentoo Base System release 1.20.1.1") @plugin.run @plugin[:platform].should == "gentoo" @plugin[:platform_family].should == "gentoo" + end + end + + describe "on exherbo" do + before(:each) do + @plugin.lsb = nil + File.should_receive(:exists?).with("/etc/exherbo-release").and_return(true) + end + + it "should set platform and platform_family to exherbo" do + @plugin.run + @plugin[:platform].should == "exherbo" + @plugin[:platform_family].should == "exherbo" end end describe "on redhat breeds" do describe "with lsb_release results" do