Sha256: 59acbd6380f742020552604e4006f2100abcb4c9d09a38e82da54b89003c9442

Contents?: true

Size: 742 Bytes

Versions: 3

Compression:

Stored size: 742 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::Core::Execution.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::Core::Execution.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

3 entries across 3 versions & 1 rubygems

Version Path
facter-2.0.1.rc1 spec/unit/lsbdistcodename_spec.rb
facter-2.0.1.rc1-x86-mingw32 spec/unit/lsbdistcodename_spec.rb
facter-2.0.1.rc1-universal-darwin spec/unit/lsbdistcodename_spec.rb