2015-10-20 14:54:02 +00:00
|
|
|
RSpec.shared_context 'Msf::UIDriver' do
|
2013-09-30 18:47:53 +00:00
|
|
|
let(:driver) do
|
|
|
|
double(
|
|
|
|
'Driver',
|
|
|
|
:framework => framework
|
|
|
|
).tap { |driver|
|
2015-12-08 20:42:42 +00:00
|
|
|
allow(driver).to receive(:on_command_proc=).with(kind_of(Proc))
|
|
|
|
allow(driver).to receive(:print_line).with(kind_of(String)) do |string|
|
2013-09-30 18:47:53 +00:00
|
|
|
@output ||= []
|
|
|
|
@output.concat string.split("\n")
|
|
|
|
end
|
2015-12-08 20:42:42 +00:00
|
|
|
allow(driver).to receive(:print_status).with(kind_of(String)) do |string|
|
2015-08-28 18:10:35 +00:00
|
|
|
@output ||= []
|
|
|
|
@output.concat string.split("\n")
|
|
|
|
end
|
2015-12-08 20:42:42 +00:00
|
|
|
allow(driver).to receive(:print_error).with(kind_of(String)) do |string|
|
2013-09-30 18:47:53 +00:00
|
|
|
@error ||= []
|
|
|
|
@error.concat string.split("\n")
|
|
|
|
end
|
|
|
|
}
|
|
|
|
end
|
2013-07-22 21:26:45 +00:00
|
|
|
end
|