Skip to content

Commit 7e6461a

Browse files
committed
Travis error correction
1 parent 8c0d5d6 commit 7e6461a

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

spec/lib/metasploit/framework/login_scanner/nessus_spec.rb

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33

44
describe Metasploit::Framework::LoginScanner::Nessus do
55

6+
subject(:http_scanner) { described_class.new }
7+
68
it_behaves_like 'Metasploit::Framework::LoginScanner::Base', has_realm_key: true, has_default_realm: false
79
it_behaves_like 'Metasploit::Framework::LoginScanner::RexSocket'
810

@@ -26,10 +28,6 @@
2628
Rex::Proto::Http::Response.new(401, 'Unauthorized')
2729
end
2830

29-
subject do
30-
described_class.new
31-
end
32-
3331
let(:response) do
3432
Rex::Proto::Http::Response.new(200, 'OK')
3533
end
@@ -52,13 +50,13 @@
5250
context 'when target is Nessus' do
5351
let(:response) { msp_html_response }
5452
it 'returns true' do
55-
expect(subject.check_setup).to be_truthy
53+
expect(http_scanner.check_setup).to be_truthy
5654
end
5755
end
5856

5957
context 'when target is not Nessus' do
6058
it 'returns false' do
61-
expect(subject.check_setup).to be_falsey
59+
expect(http_scanner.check_setup).to be_falsey
6260
end
6361
end
6462
end
@@ -76,15 +74,15 @@
7674
let(:response) { successful_auth_response }
7775
it 'returns a hash indicating a successful login' do
7876
successful_status = Metasploit::Model::Login::Status::SUCCESSFUL
79-
expect(subject.get_login_state(username, good_password)[:status]).to eq(successful_status)
77+
expect(http_scanner.get_login_state(username, good_password)[:status]).to eq(successful_status)
8078
end
8179
end
8280

8381
context 'when the creential is invalid' do
8482
let(:response) { fail_auth_response }
8583
it 'returns a hash indicating an incorrect cred' do
8684
incorrect_status = Metasploit::Model::Login::Status::INCORRECT
87-
expect(subject.get_login_state(username, good_password)[:status]).to eq(incorrect_status)
85+
expect(http_scanner.get_login_state(username, good_password)[:status]).to eq(incorrect_status)
8886
end
8987
end
9088
end
@@ -95,7 +93,7 @@
9593

9694
it 'returns a Result object indicating a successful login' do
9795
cred_obj = Metasploit::Framework::Credential.new(public: username, private: good_password)
98-
result = subject.attempt_login(cred_obj)
96+
result = http_scanner.attempt_login(cred_obj)
9997
expect(result).to be_kind_of(::Metasploit::Framework::LoginScanner::Result)
10098
expect(result.status).to eq(Metasploit::Model::Login::Status::SUCCESSFUL)
10199
end
@@ -105,7 +103,7 @@
105103
let(:response) { fail_auth_response }
106104
it 'returns a Result object indicating an incorrect cred' do
107105
cred_obj = Metasploit::Framework::Credential.new(public: username, private: bad_password)
108-
result = subject.attempt_login(cred_obj)
106+
result = http_scanner.attempt_login(cred_obj)
109107
expect(result).to be_kind_of(::Metasploit::Framework::LoginScanner::Result)
110108
expect(result.status).to eq(Metasploit::Model::Login::Status::INCORRECT)
111109
end

0 commit comments

Comments
 (0)