Sha256: 11731a9de0b7b58d2f634cd72a607d940250cc8ec13f0b868b17ae9cf8129f78

Contents?: true

Size: 655 Bytes

Versions: 60

Compression:

Stored size: 655 Bytes

Contents

#! /usr/bin/env ruby

require 'spec_helper'

describe "Kernel major version fact" do
  context "when the kernelrelease fact contains three components" do
    it "returns the first two components" do
      Facter.fact(:kernelversion).stubs(:value).returns("12.34.56")

      Facter.fact(:kernelmajversion).value.should == "12.34"
    end
  end

  context "when the kernelrelease fact only contains two components" do
    it "returns the first component" do
      Facter.fact(:kernel).stubs(:value).returns('FreeBSD')
      Facter.fact(:kernelversion).stubs(:value).returns("9.2")

      Facter.fact(:kernelmajversion).value.should == "9"
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
facter-2.5.7 spec/unit/kernelmajversion_spec.rb
facter-2.5.7-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.7-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.7-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.5.6-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.6-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.6-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.5.6 spec/unit/kernelmajversion_spec.rb
facter-2.5.5-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.5-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.5-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.5.5 spec/unit/kernelmajversion_spec.rb
facter-2.5.4-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.4-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.4-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.5.4 spec/unit/kernelmajversion_spec.rb
facter-2.5.1 spec/unit/kernelmajversion_spec.rb
facter-2.5.1-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.1-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.5.1-universal-darwin spec/unit/kernelmajversion_spec.rb