Sha256: aad592c4830185b765398c2358bb25be9e042900085e8d51e814780d035e81cb

Contents?: true

Size: 770 Bytes

Versions: 40

Compression:

Stored size: 770 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::Util::Resolution.stubs(:exec).with("hostid").returns("Larry")

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

  it "should match hostid on Linux" do
    Facter.fact(:kernel).stubs(:value).returns("Linux")
    Facter::Util::Resolution.stubs(:exec).with("hostid").returns("Curly")

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

  it "should match hostid on AIX" do
    Facter.fact(:kernel).stubs(:value).returns("AIX")
    Facter::Util::Resolution.stubs(:exec).with("hostid").returns("Moe")

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

Version data entries

40 entries across 40 versions & 2 rubygems

Version Path
facter-1.6.17.rc1 spec/unit/uniqueid_spec.rb
facter-1.6.16 spec/unit/uniqueid_spec.rb
facter-1.6.15 spec/unit/uniqueid_spec.rb
facter-1.6.15.rc1 spec/unit/uniqueid_spec.rb
facter-1.6.14 spec/unit/uniqueid_spec.rb
facter-1.6.14.rc1 spec/unit/uniqueid_spec.rb
facter-1.6.13 spec/unit/uniqueid_spec.rb
facter-1.6.13.rc1 spec/unit/uniqueid_spec.rb
facter-1.6.12 spec/unit/uniqueid_spec.rb
librarian-puppet-0.9.4 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/uniqueid_spec.rb
facter-1.6.12.rc2 spec/unit/uniqueid_spec.rb
facter-1.6.12.rc1 spec/unit/uniqueid_spec.rb
librarian-puppet-0.9.3 vendor/gems/ruby/1.8/gems/facter-1.6.11/spec/unit/uniqueid_spec.rb
facter-1.6.11 spec/unit/uniqueid_spec.rb
facter-1.6.10 spec/unit/uniqueid_spec.rb
facter-1.6.9 spec/unit/uniqueid_spec.rb
facter-1.6.8 spec/unit/uniqueid_spec.rb
facter-1.6.7 spec/unit/uniqueid_spec.rb
facter-1.6.6 spec/unit/uniqueid_spec.rb
facter-1.6.5 spec/unit/uniqueid_spec.rb