Sha256: bdd01f5995bfd0f65aef9c6c21f179bd7163a29ed94e5bcc4e38867ef4e7876f

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

#
# Author:: Daniel DeLeo <dan@kallistec.com>
# Copyright:: Copyright (c) 2009 Daniel DeLeo
# 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.join(File.dirname(__FILE__), '..', '..', '..', '/spec_helper.rb')

describe Ohai::System, "Solaris2.X hostname plugin" do
  before(:each) do
    @ohai = Ohai::System.new    
    @ohai.stub!(:require_plugin).and_return(true)
    @ohai[:os] = "solaris2"
    @ohai.stub!(:from).with("hostname").and_return("kitteh")
    @ohai.stub!(:from).with("domainname").and_return("inurfridge.eatinurfoodz")
  end
  
  it_should_check_from("solaris2::hostname", "hostname", "hostname", "kitteh")
  
  it "should get the fqdn value from 'hostname' + 'domainname'" do
    @ohai.should_receive(:from).with("hostname").and_return("kitteh")
    @ohai.should_receive(:from).with("domainname").and_return("inurfridge.eatinurfoodz")
    @ohai._require_plugin("solaris2::hostname")
  end
  
  it "should set the fqdn to the value from 'hostname' and 'domainname'" do
    @ohai._require_plugin("solaris2::hostname")
    @ohai["fqdn"].should == "kitteh.inurfridge.eatinurfoodz"
  end
  
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ohai-0.5.0 spec/ohai/plugins/solaris2/hostname_spec.rb
ohai-0.4.0 spec/ohai/plugins/solaris2/hostname_spec.rb
ohai-0.3.6 spec/ohai/plugins/solaris2/hostname_spec.rb
ohai-0.3.4 spec/ohai/plugins/solaris2/hostname_spec.rb