aboutsummaryrefslogtreecommitdiffstats
path: root/modules/facter/spec/unit/lib_dir.rb
blob: 1d5c462417027dffda0752b84b2b1f29cb038e5c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/usr/bin/env rspec

require 'spec_helper'

describe "Lib_dir fact" do
    it "should default to /usr/lib" do
        Facter.fact(:architecture).stubs(:value).returns("bogus")
        Facter.fact(:lib_dir).value.should == "/usr/lib/"
    end

    archs = Hash.new
    # TODO add arm 64 and others
    archs = {
        "i586" => "/usr/lib/",
        "x86_64" => "/usr/lib64/",
    }
    archs.each do |arch, dir|
        it "should be #{dir} on #{arch}" do
            Facter.fact(:architecture).stubs(:value).returns(arch)
            Facter.fact(:lib_dir).value.should == dir
        end
    end
end