stub out private meterpreter accessor method net

This commit is contained in:
Greg Mikeska 2015-12-09 16:46:51 -06:00 committed by Brent Cook
parent 2a6db4092d
commit b29459747b
1 changed files with 3 additions and 2 deletions

View File

@ -34,8 +34,9 @@ RSpec.describe Msf::Sessions::Meterpreter do
subject(:connected_address) do
m = described_class.new(StringIO.new(""), skip_ssl: true)
allow(m).to receive_message_chain(:net, :config, :get_interfaces).and_return(interfaces)
allow(m).to receive_message_chain(:net, :config, :get_routes).and_return(routes)
allow(m).to receive_message_chain(:private_methods, :net)
allow(m).to receive_message_chain(:private_methods, :net, :config, :get_interfaces).and_return(interfaces)
allow(m).to receive_message_chain(:private_methods, :net, :config, :get_routes).and_return(routes)
m.session_host = session_host
m.send(:find_internet_connected_address)