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.7.6 spec/unit/uniqueid_spec.rb
facter-1.7.5 spec/unit/uniqueid_spec.rb
facter-1.7.5.rc2 spec/unit/uniqueid_spec.rb
facter-1.7.5.rc1 spec/unit/uniqueid_spec.rb
facter-1.7.4 spec/unit/uniqueid_spec.rb
facter-1.7.4.rc1 spec/unit/uniqueid_spec.rb
facter-1.7.3 spec/unit/uniqueid_spec.rb
facter-1.7.3.rc1 spec/unit/uniqueid_spec.rb
facter-1.7.2 spec/unit/uniqueid_spec.rb
facter-1.7.2.rc1 spec/unit/uniqueid_spec.rb
facter-1.7.1 spec/unit/uniqueid_spec.rb
facter-1.7.1.rc1 spec/unit/uniqueid_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/uniqueid_spec.rb
facter-1.7.0 spec/unit/uniqueid_spec.rb
facter-1.7.0.rc2 spec/unit/uniqueid_spec.rb
facter-1.7.0.rc1 spec/unit/uniqueid_spec.rb
facter-1.6.18 spec/unit/uniqueid_spec.rb
facter-1.6.18.rc1 spec/unit/uniqueid_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/facter-1.6.17/spec/unit/uniqueid_spec.rb
facter-1.6.17 spec/unit/uniqueid_spec.rb