metasploit-framework/spec/support/shared/contexts/msf/ui_driver.rb

19 lines
483 B
Ruby
Raw Normal View History

shared_context 'Msf::UIDriver' do
let(:driver) do
double(
'Driver',
:framework => framework
).tap { |driver|
driver.stub(:on_command_proc=).with(kind_of(Proc))
driver.stub(:print_line).with(kind_of(String)) do |string|
@output ||= []
@output.concat string.split("\n")
end
driver.stub(:print_error).with(kind_of(String)) do |string|
@error ||= []
@error.concat string.split("\n")
end
}
end
2013-07-22 21:26:45 +00:00
end