diff options
author | Prabhu Das <prabhu.das@clogeny.com> | 2013-08-13 19:48:08 +0530 |
---|---|---|
committer | adamedx <adamed@opscode.com> | 2013-08-19 11:52:45 -0700 |
commit | 52415bb76de03a84159c3fefc37ad479de887416 (patch) | |
tree | 25bd24deb94aacd30834eb5a27c7fe2509ee0ee9 /spec | |
parent | ba5d01c5495e0f47a7a10de1cfa19f16974e2b68 (diff) | |
download | ohai-52415bb76de03a84159c3fefc37ad479de887416.tar.gz |
ohai plugins hostname and platform specs.
Diffstat (limited to 'spec')
-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 |