last of the validations

finalized validation for SSH lgoinscanner
bug/bundler_fix
David Maloney 2014-04-16 13:34:23 -05:00
parent bf20ed5812
commit 756488b581
No known key found for this signature in database
GPG Key ID: DEDBA9DC3A913DB2
2 changed files with 14 additions and 0 deletions

View File

@ -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

View File

@ -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