-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Joshua Hoblitt
committed
Nov 7, 2013
1 parent
1b1e846
commit 54e6247
Showing
2 changed files
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
Facter.add('mdadm') do | ||
confine :kernel => 'Linux' | ||
setcode do | ||
Facter::Util::Resolution.which('mdadm') | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
require 'spec_helper' | ||
|
||
describe 'mdadm', :type => :fact do | ||
before(:each) { Facter.clear } | ||
|
||
context 'kernel => Linux' do | ||
it 'should find the executable' do | ||
Facter.fact(:kernel).stubs(:value).returns('Linux') | ||
Facter::Util::Resolution.stubs(:which).with('mdadm').returns('/sbin/mdadm') | ||
|
||
Facter.fact(:mdadm).value.should == '/sbin/mdadm' | ||
end | ||
end | ||
end |