module-postgresql/spec/unit/facts/postgres_default_version_spec.rb

15 lines
504 B
Ruby
Raw Normal View History

require 'spec_helper'
describe 'postgres_default_version', :type => :fact do
it 'should handle redhat 6.0' do
Facter.fact(:osfamily).stubs(:value).returns 'RedHat'
Facter.fact(:operatingsystemrelease).stubs(:value).returns '6.0'
Facter.fact(:postgres_default_version).value.should == '8.4'
end
it 'should return unknown if osfamily is unknown' do
Facter.fact(:osfamily).expects(:value).returns 'test'
Facter.fact(:postgres_default_version).value.should eq 'unknown'
end
end