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.4.1 spec/unit/kernelmajversion_spec.rb
facter-2.4.1-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.4.1-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.4.1-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.4.0 spec/unit/kernelmajversion_spec.rb
facter-2.4.0-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.4.0-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.4.0-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.3.0 spec/unit/kernelmajversion_spec.rb
facter-2.3.0-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.3.0-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.3.0-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.2.0 spec/unit/kernelmajversion_spec.rb
facter-2.2.0-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.2.0-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.2.0-universal-darwin spec/unit/kernelmajversion_spec.rb
facter-2.1.0 spec/unit/kernelmajversion_spec.rb
facter-2.1.0-x86-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.1.0-x64-mingw32 spec/unit/kernelmajversion_spec.rb
facter-2.1.0-universal-darwin spec/unit/kernelmajversion_spec.rb