Skip to content

Commit

Permalink
Merge pull request #825 from jfryman/test-for-813
Browse files Browse the repository at this point in the history
add test for #813
  • Loading branch information
3flex authored Jun 24, 2016
2 parents 204512f + 9002d86 commit 2e33abe
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion spec/unit/nginx_version_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
}

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')
Expand All @@ -15,5 +15,14 @@
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

0 comments on commit 2e33abe

Please sign in to comment.