3 RSpec.configure do |config|
4 config.mock_with :rspec
7 describe Facter::Util::Fact do
12 describe 'rabbitmq_version' do
13 context 'with value' do
15 allow(Facter::Util::Resolution).to receive(:which).with('rabbitmqadmin') { true }
16 allow(Facter::Core::Execution).to receive(:execute).with('rabbitmqadmin --version 2>&1') { 'rabbitmqadmin 3.6.0' }
19 expect(Facter.fact(:rabbitmq_version).value).to eq('3.6.0')
22 context 'rabbitmqadmin is not in path' do
24 allow(Facter::Util::Resolution).to receive(:which).with('rabbitmqadmin') { false }
27 expect(Facter.fact(:rabbitmq_version).value).to be_nil