Merge pull request #825 from jfryman/test-for-813

add test for #813
This commit is contained in:
Matthew Haughton 2016-06-23 23:13:51 -04:00 committed by GitHub
commit 2e33abed01

View file

@ -6,7 +6,7 @@ describe Facter::Util::Fact do
}
describe "nginx_version" do
context 'with value' do
context 'with current version output format' do
before :each do
Facter::Util::Resolution.stubs(:which).with('nginx').returns(true)
Facter::Util::Resolution.stubs(:exec).with('nginx -v 2>&1').returns('nginx version: nginx/1.8.1')
@ -15,5 +15,14 @@ describe Facter::Util::Fact do
expect(Facter.fact(:nginx_version).value).to eq('1.8.1')
}
end
context 'with old version output format' do
before :each do
Facter::Util::Resolution.stubs(:which).with('nginx').returns(true)
Facter::Util::Resolution.stubs(:exec).with('nginx -v 2>&1').returns('nginx: nginx version: nginx/0.7.0')
end
it {
expect(Facter.fact(:nginx_version).value).to eq('0.7.0')
}
end
end
end