Sha256: 9512bcb9dd12f8df33242ef42f3daeefba0a774516dcec99776219d996f44bd0

Contents?: true

Size: 1.11 KB

Versions: 56

Compression:

Stored size: 1.11 KB

Contents

require 'spec_helper'
require 'facter/operatingsystem/cumuluslinux'

describe Facter::Operatingsystem::CumulusLinux do
  subject { described_class.new }

  before :all do
    Facter.fact(:kernel).stubs(:value).returns("Linux")
  end

  describe "Operating system fact" do
    it "should identify Cumulus Linux" do
      os = subject.get_operatingsystem
      expect(os).to eq "CumulusLinux"
    end
  end

  describe "Osfamily fact" do
    it "should return Debian" do
      osfamily = subject.get_osfamily
      expect(osfamily).to eq "Debian"
    end
  end

  describe "Operatingsystemrelease fact" do
    it "uses '/etc/os-release" do
      Facter::Util::Operatingsystem.expects(:os_release).returns({"VERSION_ID" => "1.5.0"})
      release = subject.get_operatingsystemrelease
      expect(release).to eq "1.5.0"
    end
  end

  describe "Operatingsystemmajrelease fact" do
    it "should return the majrelease value based on its operatingsystemrelease" do
      subject.expects(:get_operatingsystemrelease).returns("1.5.0")
      release = subject.get_operatingsystemmajrelease
      expect(release).to eq "1"
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
facter-2.5.0 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.5.0-x86-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.5.0-x64-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.5.0-universal-darwin spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.6 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.6-x86-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.6-x64-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.6-universal-darwin spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.5 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.5-x86-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.5-x64-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.5-universal-darwin spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.4 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.4-x86-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.4-x64-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.4-universal-darwin spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.3 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.3-x86-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.3-x64-mingw32 spec/unit/operatingsystem/cumuluslinux_spec.rb
facter-2.4.3-universal-darwin spec/unit/operatingsystem/cumuluslinux_spec.rb