Sha256: 23b6ef58fedf19b5b259ceb6c35348fa5b6b9aaabbaefa0e639f4daa76b0dd72

Contents?: true

Size: 1.29 KB

Versions: 3

Compression:

Stored size: 1.29 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::Core::Execution.stubs(:exec).with("uname -p", anything).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::Core::Execution.stubs(:exec).with("uname -p", anything).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::Core::Execution.stubs(:exec).with("uname -p", anything).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::Core::Execution.stubs(:exec).with("uname -p", anything).returns("Clyde")

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

  it "should match uname -m on HP-UX" do
    Facter.fact(:kernel).stubs(:value).returns("HP-UX")
    Facter::Core::Execution.stubs(:exec).with("uname -m", anything).returns("Pac-Man")

    Facter.fact(:hardwareisa).value.should == "Pac-Man"
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
facter-2.0.1.rc2 spec/unit/hardwareisa_spec.rb
facter-2.0.1.rc2-x86-mingw32 spec/unit/hardwareisa_spec.rb
facter-2.0.1.rc2-universal-darwin spec/unit/hardwareisa_spec.rb