Files
metasploit-gs/spec/support/shared/contexts/msf/ui_driver.rb
T

27 lines
833 B
Ruby
Raw Normal View History

2015-10-20 09:54:02 -05:00
RSpec.shared_context 'Msf::UIDriver' do
2013-09-30 13:47:53 -05:00
let(:driver) do
double(
'Driver',
:framework => framework
).tap { |driver|
2015-12-08 14:42:42 -06: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 13:47:53 -05:00
@output ||= []
@output.concat string.split("\n")
end
2015-12-08 14:42:42 -06:00
allow(driver).to receive(:print_status).with(kind_of(String)) do |string|
@output ||= []
@output.concat string.split("\n")
end
2015-12-08 14:42:42 -06:00
allow(driver).to receive(:print_error).with(kind_of(String)) do |string|
2013-09-30 13:47:53 -05:00
@error ||= []
@error.concat string.split("\n")
end
2016-11-15 19:20:42 -06:00
allow(driver).to receive(:print_bad).with(kind_of(String)) do |string|
@error ||= []
@error.concat string.split("\n")
end
2013-09-30 13:47:53 -05:00
}
end
2013-07-22 16:26:45 -05:00
end