Sha256: 5adbe830e77196d5434bbea6d97bc803ff00b06268822f941c6fe60ddcf6d48a

Contents?: true

Size: 541 Bytes

Versions: 4

Compression:

Stored size: 541 Bytes

Contents

require 'spec_helper'

describe "gid fact" do

  describe "on systems with id" do
    it "should return the current group" do
      Facter::Core::Execution.expects(:which).with('id').returns(true)
      Facter::Core::Execution.expects(:exec).once.with('id -ng').returns 'bar'

      Facter.fact(:gid).value.should == 'bar'
    end
  end

  describe "on systems without id" do
    it "is not supported" do
      Facter::Core::Execution.expects(:which).with('id').returns(false)

      Facter.fact(:gid).value.should == nil
    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
facter-2.2.0 spec/unit/gid_spec.rb
facter-2.2.0-x86-mingw32 spec/unit/gid_spec.rb
facter-2.2.0-x64-mingw32 spec/unit/gid_spec.rb
facter-2.2.0-universal-darwin spec/unit/gid_spec.rb