Sha256: e0c8191b0ed5aa2fe3b99b39aac8191533535a712333a04a2bf0335b3f434187

Contents?: true

Size: 773 Bytes

Versions: 15

Compression:

Stored size: 773 Bytes

Contents

#! /usr/bin/env ruby -S rspec

require 'spec_helper'

describe "Kernel version fact" do
  
  describe "on Solaris/Sun OS" do
    before do
      Facter.fact(:kernel).stubs(:value).returns('sunos')
      Facter::Util::Resolution.stubs(:exec).with('uname -v').returns("1.234.5")
    end 
    
    it "should return the kernel version using 'uname -v'" do 
      Facter.fact(:kernelversion).value.should == "1.234.5"
    end 
  end
  
  describe "on everything else" do
    before do 
      Facter.fact(:kernel).stubs(:value).returns('linux')
      Facter.fact(:kernelrelease).stubs(:value).returns('1.23.4-56')
    end 
    
    it "should return the kernel version using kernel release" do 
      Facter.fact(:kernelversion).value.should == "1.23.4"
    end 
  end
end 




Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
facter-1.7.6 spec/unit/kernelversion_spec.rb
facter-1.7.5 spec/unit/kernelversion_spec.rb
facter-1.7.5.rc2 spec/unit/kernelversion_spec.rb
facter-1.7.5.rc1 spec/unit/kernelversion_spec.rb
facter-1.7.4 spec/unit/kernelversion_spec.rb
facter-1.7.4.rc1 spec/unit/kernelversion_spec.rb
facter-1.7.3 spec/unit/kernelversion_spec.rb
facter-1.7.3.rc1 spec/unit/kernelversion_spec.rb
facter-1.7.2 spec/unit/kernelversion_spec.rb
facter-1.7.2.rc1 spec/unit/kernelversion_spec.rb
facter-1.7.1 spec/unit/kernelversion_spec.rb
facter-1.7.1.rc1 spec/unit/kernelversion_spec.rb
facter-1.7.0 spec/unit/kernelversion_spec.rb
facter-1.7.0.rc2 spec/unit/kernelversion_spec.rb
facter-1.7.0.rc1 spec/unit/kernelversion_spec.rb