Files
metasploit-gs/spec/support/shared/contexts/msf/ui_driver.rb
T
Greg Mikeska 2fc0c0b326 switch expect stubs
in ui_driver shared context to allows
2015-12-10 21:47:22 -06:00

23 lines
683 B
Ruby

RSpec.shared_context 'Msf::UIDriver' do
let(:driver) do
double(
'Driver',
:framework => framework
).tap { |driver|
allow(driver).to receive(:on_command_proc=).with(kind_of(Proc))
allow(driver).to receive(:print_line).with(kind_of(String)) do |string|
@output ||= []
@output.concat string.split("\n")
end
allow(driver).to receive(:print_status).with(kind_of(String)) do |string|
@output ||= []
@output.concat string.split("\n")
end
allow(driver).to receive(:print_error).with(kind_of(String)) do |string|
@error ||= []
@error.concat string.split("\n")
end
}
end
end