parent
bf20ed5812
commit
756488b581
|
@ -1,3 +1,5 @@
|
|||
require 'metasploit/framework/login_scanner/invalid'
|
||||
|
||||
module Metasploit
|
||||
module Framework
|
||||
module LoginScanner
|
||||
|
@ -38,6 +40,12 @@ module Metasploit
|
|||
end
|
||||
end
|
||||
|
||||
def valid!
|
||||
unless valid?
|
||||
raise Metasploit::Framework::LoginScanner::Invalid.new(self)
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def host_address_must_be_valid
|
||||
|
|
|
@ -155,5 +155,11 @@ describe Metasploit::Framework::LoginScanner::SSH do
|
|||
expect(ssh_scanner.errors[:cred_details]).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
context '#valid!' do
|
||||
it 'raises a Metasploit::Framework::LoginScanner::Invalid when validations fail' do
|
||||
expect{ssh_scanner.valid!}.to raise_error Metasploit::Framework::LoginScanner::Invalid
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue