Sha256: 8321feb48e0d9f0cafad26f6d0454122529b008138e6b81369b095f1f812f41d

Contents?: true

Size: 806 Bytes

Versions: 72

Compression:

Stored size: 806 Bytes

Contents

#!/usr/bin/env ruby

require 'spec_helper'
require 'facter'

describe "Uniqueid fact" do
  it "should match hostid on Solaris" do
    Facter.fact(:kernel).stubs(:value).returns("SunOS")
    Facter::Core::Execution.stubs(:execute).with("hostid", anything).returns("Larry")

    Facter.fact(:uniqueid).value.should == "Larry"
  end

  it "should match hostid on Linux" do
    Facter.fact(:kernel).stubs(:value).returns("Linux")
    Facter::Core::Execution.stubs(:execute).with("hostid", anything).returns("Curly")

    Facter.fact(:uniqueid).value.should == "Curly"
  end

  it "should match hostid on AIX" do
    Facter.fact(:kernel).stubs(:value).returns("AIX")
    Facter::Core::Execution.stubs(:execute).with("hostid", anything).returns("Moe")

    Facter.fact(:uniqueid).value.should == "Moe"
  end
end

Version data entries

72 entries across 72 versions & 1 rubygems

Version Path
facter-2.5.7 spec/unit/uniqueid_spec.rb
facter-2.5.7-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.7-x64-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.7-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.5.6-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.6-x64-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.6-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.5.6 spec/unit/uniqueid_spec.rb
facter-2.5.5-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.5-x64-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.5-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.5.5 spec/unit/uniqueid_spec.rb
facter-2.5.4-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.4-x64-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.4-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.5.4 spec/unit/uniqueid_spec.rb
facter-2.5.1 spec/unit/uniqueid_spec.rb
facter-2.5.1-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.1-x64-mingw32 spec/unit/uniqueid_spec.rb
facter-2.5.1-universal-darwin spec/unit/uniqueid_spec.rb