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.0.2 spec/unit/uniqueid_spec.rb
facter-2.0.2-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.0.2-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.0.1 spec/unit/uniqueid_spec.rb
facter-2.0.1-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.0.1-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.0.1.rc4 spec/unit/uniqueid_spec.rb
facter-2.0.1.rc4-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.0.1.rc4-universal-darwin spec/unit/uniqueid_spec.rb
facter-2.0.1.rc3 spec/unit/uniqueid_spec.rb
facter-2.0.1.rc3-x86-mingw32 spec/unit/uniqueid_spec.rb
facter-2.0.1.rc3-universal-darwin spec/unit/uniqueid_spec.rb