diff options
author | David Schmitt <david.schmitt@puppetlabs.com> | 2015-09-01 08:31:31 +0100 |
---|---|---|
committer | David Schmitt <david.schmitt@puppetlabs.com> | 2015-09-01 08:31:31 +0100 |
commit | 9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007 (patch) | |
tree | 552a7c02b4615a7e2f772e70628628330e7ccda4 /spec/unit/facter | |
parent | b10978703a5e4f07f240c509a3cf881210fbd5c5 (diff) | |
parent | 6c2a003f2139a482f92f245ce1d49830be13c5f1 (diff) | |
download | puppet-stdlib-9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007.tar.gz puppet-stdlib-9352db77a6d265f1a49ab6b4d0f9e1df2ed2b007.tar.bz2 |
Merge pull request #515 from jfautley/ticket/MODULES-2478-support_root_home_fact_on_AIX
(MODULES-2478) Make root_home fact work on AIX using native lsuser command
Diffstat (limited to 'spec/unit/facter')
-rwxr-xr-x | spec/unit/facter/root_home_spec.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/unit/facter/root_home_spec.rb b/spec/unit/facter/root_home_spec.rb index 98fe141..ac5160a 100755 --- a/spec/unit/facter/root_home_spec.rb +++ b/spec/unit/facter/root_home_spec.rb @@ -49,4 +49,17 @@ describe 'root_home', :type => :fact do end end + context "aix" do + before do + Facter.fact(:kernel).stubs(:value).returns("AIX") + Facter.fact(:osfamily).stubs(:value).returns("AIX") + end + let(:expected_root_home) { "/root" } + sample_lsuser = File.read(fixtures('lsuser','root')) + + it "should return /root" do + Facter::Util::Resolution.stubs(:exec).with("lsuser -C -a home root").returns(sample_lsuser) + expect(Facter.fact(:root_home).value).to eq(expected_root_home) + end + end end |