Sha256: 6f8b6f6f44b525ad302bb582a1dce1d4c03af10f7cc431b265fb6af635d3b902

Contents?: true

Size: 1.02 KB

Versions: 14

Compression:

Stored size: 1.02 KB

Contents

#!/usr/bin/env ruby

require 'spec_helper'
require 'facter'

describe "Hardwareisa fact" do
  it "should match uname -p on Linux" do
    Facter.fact(:kernel).stubs(:value).returns("Linux")
    Facter::Util::Resolution.stubs(:exec).with("uname -p").returns("Inky")

    Facter.fact(:hardwareisa).value.should == "Inky"
  end

  it "should match uname -p on Darwin" do
    Facter.fact(:kernel).stubs(:value).returns("Darwin")
    Facter::Util::Resolution.stubs(:exec).with("uname -p").returns("Blinky")

    Facter.fact(:hardwareisa).value.should == "Blinky"
  end

  it "should match uname -p on SunOS" do
    Facter.fact(:kernel).stubs(:value).returns("SunOS")
    Facter::Util::Resolution.stubs(:exec).with("uname -p").returns("Pinky")

    Facter.fact(:hardwareisa).value.should == "Pinky"
  end

  it "should match uname -p on FreeBSD" do
    Facter.fact(:kernel).stubs(:value).returns("FreeBSD")
    Facter::Util::Resolution.stubs(:exec).with("uname -p").returns("Clyde")

    Facter.fact(:hardwareisa).value.should == "Clyde"
  end
end

Version data entries

14 entries across 14 versions & 2 rubygems

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