diff options
author | Thom May <thom@clearairturbulence.org> | 2009-02-11 18:59:51 -0500 |
---|---|---|
committer | Thom May <thom@clearairturbulence.org> | 2009-02-11 18:59:51 -0500 |
commit | f4cb9dad656dd4b4b994e33fa8b4ca527bf16fef (patch) | |
tree | 3801d68cc6f012dda1d5d58501d2c0acdfc93e50 | |
parent | b6c41e00d7b68fd4e76b749af2b6c2e0a765bc7c (diff) | |
download | ohai-f4cb9dad656dd4b4b994e33fa8b4ca527bf16fef.tar.gz |
OHAI-54 - start specs for linux::platform
-rw-r--r-- | spec/ohai/plugins/linux/platform_spec.rb | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/spec/ohai/plugins/linux/platform_spec.rb b/spec/ohai/plugins/linux/platform_spec.rb index 6ffb4caf..6dbd1154 100644 --- a/spec/ohai/plugins/linux/platform_spec.rb +++ b/spec/ohai/plugins/linux/platform_spec.rb @@ -23,6 +23,7 @@ describe Ohai::System, "Linux plugin platform" do before(:each) do @ohai = Ohai::System.new @ohai.stub!(:require_plugin).and_return(true) + @ohai.extend(SimpleFromFile) @ohai[:os] = "linux" @ohai[:lsb] = Mash.new end @@ -48,4 +49,25 @@ describe Ohai::System, "Linux plugin platform" do @ohai[:platform_version].should == "8.04" end end + + describe "on debian" do + before(:each) do + @ohai.lsb = nil + end + + it "should check for the existance of debian_version" do + File.should_receive(:exists?).with("/etc/debian_version").and_return(true) + @ohai._require_plugin("linux::platform") + end + + it "should read the version from /etc/debian_version" do + File.should_receive(:read).with("/etc/debian_version").and_return("") + @ohai._require_plugin("linux::platform") + @ohai[:platform_version].should == nil + end + + + end + + end |