File tree Expand file tree Collapse file tree 3 files changed +8
-7
lines changed
lib/puppet/resource_api/transport
fixtures/test_module/lib/puppet/transport
puppet/resource_api/transport Expand file tree Collapse file tree 3 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ def initialize(name, url_or_config)
2121
2222 def facts
2323 # @transport.facts + custom_facts # look into custom facts work by TP
24- @transport . facts
24+ @transport . facts ( nil )
2525 end
2626
2727 def respond_to_missing? ( name , _include_private )
Original file line number Diff line number Diff line change 11module Puppet ::Transport
22# a transport for a test_device
33class TestDevice
4- def initialize ( connection_info ) ;
4+ def initialize ( _context , connection_info ) ;
55 puts connection_info
66 end
77
8- def facts
8+ def facts ( _context )
99 { 'foo' => 'bar' }
1010 end
1111
12- def verify
12+ def verify ( _context )
1313 return true
1414 end
1515
16- def close
16+ def close ( _context )
1717 return
1818 end
1919end
Original file line number Diff line number Diff line change 4242
4343 it 'will return the facts provided by the transport' do
4444 allow ( Puppet ::ResourceApi ::Transport ) . to receive ( :connect ) . and_return ( transport )
45- allow ( transport ) . to receive ( :facts ) . and_return ( facts )
45+ allow ( transport ) . to receive ( :facts ) . with ( nil ) . and_return ( facts )
4646
4747 expect ( instance . facts ) . to eq ( facts )
4848 end
5353 context 'when the transport can handle the method' do
5454 let ( :instance ) { described_class . new ( 'wibble' , { } ) }
5555 let ( :transport ) { instance_double ( Puppet ::Transport ::TestDevice , 'transport' ) }
56+ let ( :context ) { instance_double ( Puppet ::ResourceApi ::PuppetContext , 'context' ) }
5657
5758 it 'will return the facts provided by the transport' do
5859 allow ( Puppet ::ResourceApi ::Transport ) . to receive ( :connect ) . and_return ( transport )
5960 expect ( transport ) . to receive ( :close )
6061
61- instance . close
62+ instance . close ( context )
6263 end
6364 end
6465
You can’t perform that action at this time.
0 commit comments