Sha256: 5a956cb9caf6961e622b43eebff6b7df296c5b3a5e4a5ae27866bc81bc6d1b09
Contents?: true
Size: 738 Bytes
Versions: 9
Compression:
Stored size: 738 Bytes
Contents
#!/usr/bin/env rspec require 'spec_helper' describe "lsbdistid 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 id through lsb_release -i -s 2>/dev/null" do Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s 2>/dev/null').returns 'Gentoo' Facter.fact(:lsbdistid).value.should == 'Gentoo' end it "should return nil if lsb_release is not installed 2>/dev/null" do Facter::Util::Resolution.stubs(:exec).with('lsb_release -i -s 2>/dev/null').returns nil Facter.fact(:lsbdistid).value.should be_nil end end end end
Version data entries
9 entries across 9 versions & 2 rubygems