diff options
author | Prabhu Das <prabhu.das@clogeny.com> | 2013-08-13 19:48:08 +0530 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-09-23 16:02:49 -0700 |
commit | 22944e984c0b33722440f69ee199b444b8d2e7bf (patch) | |
tree | 1b83eadbdd105a635cb8651d023adf6613a5fe1d | |
parent | c67e12d7ee66539e3b25904483953c048673a13f (diff) | |
download | ohai-22944e984c0b33722440f69ee199b444b8d2e7bf.tar.gz |
ohai plugins hostname and platform specs.
-rw-r--r-- | spec/unit/plugins/aix/hostname_spec.rb | 28 | ||||
-rw-r--r-- | spec/unit/plugins/aix/platform_spec.rb | 39 |
2 files changed, 67 insertions, 0 deletions
diff --git a/spec/unit/plugins/aix/hostname_spec.rb b/spec/unit/plugins/aix/hostname_spec.rb new file mode 100644 index 00000000..495d81fa --- /dev/null +++ b/spec/unit/plugins/aix/hostname_spec.rb @@ -0,0 +1,28 @@ +# +# Author:: Prabhu Das (<prabhu.das@clogeny.com>) +# Copyright:: Copyright (c) 2013 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb') + +describe Ohai::System, "Aix hostname plugin" do + before(:each) do + @ohai = Ohai::System.new + @plugin = Ohai::DSL::Plugin.new(@ohai, File.expand_path("aix/hostname.rb", PLUGIN_PATH)) + @plugin.stub(:from).with("hostname").and_return("aix_admin") + end + + it_should_check_from("aix::hostname", "hostname", "hostname", "aix_admin") +end diff --git a/spec/unit/plugins/aix/platform_spec.rb b/spec/unit/plugins/aix/platform_spec.rb new file mode 100644 index 00000000..bc679185 --- /dev/null +++ b/spec/unit/plugins/aix/platform_spec.rb @@ -0,0 +1,39 @@ +# +# Author:: Prabhu Das (<prabhu.das@clogeny.com>) +# Copyright:: Copyright (c) 2013 Opscode, Inc. +# License:: Apache License, Version 2.0 +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +require File.expand_path(File.dirname(__FILE__) + '/../../../spec_helper.rb') + +describe Ohai::System, "Aix plugin platform" do + before(:each) do + @ohai = Ohai::System.new + @plugin = Ohai::DSL::Plugin.new(@ohai, File.expand_path("aix/platform.rb", PLUGIN_PATH)) + @plugin[:kernel] = Mash.new + @plugin[:kernel][:name] = "aix" + @plugin[:kernel][:version] = "1" + @plugin[:kernel][:release] = "0" + @plugin.stub(:require_plugin).and_return(true) + @plugin.run + end + + it "should set platform to aix" do + @plugin[:platform].should == "aix" + end + + it "should set the platform_version" do + @plugin[:platform_version].should == "1.0" + end +end |