File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
spec/lib/metasploit/framework/login_scanner Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 8
8
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
9
9
it_behaves_like 'Metasploit::Framework::LoginScanner::HTTP'
10
10
11
+ subject do
12
+ described_class . new
13
+ end
14
+
15
+ let ( :response ) { Rex ::Proto ::Http ::Response . new ( 200 , 'OK' ) }
16
+
17
+ before ( :each ) do
18
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :request_cgi ) . with ( any_args )
19
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :send_recv ) . with ( any_args ) . and_return ( response )
20
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :set_config ) . with ( any_args )
21
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :close )
22
+ allow_any_instance_of ( Rex ::Proto ::Http ::Client ) . to receive ( :connect )
23
+ end
24
+
25
+ describe '#send_request' do
26
+ context 'when a valid request is sent' do
27
+ it 'returns a response object' do
28
+ expect ( subject . send_request ( { 'uri' => '/' } ) ) . to be_kind_of ( Rex ::Proto ::Http ::Response )
29
+ end
30
+ end
31
+ end
32
+
11
33
end
You can’t perform that action at this time.
0 commit comments