Sha256: d03e9defb816e8b5559cbea0c76ca1c049e37cd4244418d1be99e6c5fbf7fba2

Contents?: true

Size: 744 Bytes

Versions: 26

Compression:

Stored size: 744 Bytes

Contents

#! /usr/bin/env ruby

require 'spec_helper'

describe "lsbdistcodename fact" do

  [ "Linux", "GNU/kFreeBSD"].each do |kernel|
    describe "on #{kernel}" do
      before :each do
        Facter.fact(:kernel).stubs(:value).returns kernel
      end

      it "should return the codename through lsb_release -c -s 2>/dev/null" do
        Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s 2>/dev/null').returns 'n/a'
        Facter.fact(:lsbdistcodename).value.should == 'n/a'
      end

      it "should return nil if lsb_release is not installed" do
        Facter::Util::Resolution.stubs(:exec).with('lsb_release -c -s 2>/dev/null').returns nil
        Facter.fact(:lsbdistcodename).value.should be_nil
      end
    end
  end

end

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
facter-1.6.17.rc1 spec/unit/lsbdistcodename_spec.rb
facter-1.6.16 spec/unit/lsbdistcodename_spec.rb
facter-1.6.15 spec/unit/lsbdistcodename_spec.rb
facter-1.6.15.rc1 spec/unit/lsbdistcodename_spec.rb
facter-1.6.14 spec/unit/lsbdistcodename_spec.rb
facter-1.6.14.rc1 spec/unit/lsbdistcodename_spec.rb