File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change 11require 'spec_helper'
22
33describe 'PE Version specs' do
4+ # we mock calls for the puppetversion fact, it is not normal to expect nil responses when mocking.
5+ RSpec ::Mocks . configuration . allow_message_expectations_on_nil = true
46 context 'when puppetversion is nil' do
57 before :each do
68 allow ( Facter . fact ( :puppetversion ) ) . to receive ( :value ) . and_return ( nil )
2022 puppetversion = "2.7.19 (Puppet Enterprise #{ version } )"
2123 context "puppetversion => #{ puppetversion } " do
2224 before :each do
23- allow ( Facter . fact ( :puppetversion ) ) . to receive ( :value ) . and_return ( puppetversion )
25+ allow ( Facter ) . to receive ( :value ) . with ( anything ) . and_call_original
26+ allow ( Facter ) . to receive ( :value ) . with ( 'puppetversion' ) . and_return ( puppetversion )
2427 end
2528
2629 ( major , minor , patch ) = version . split ( '.' )
You can’t perform that action at this time.
0 commit comments