metasploit-credential 0.14.5 → 0.14.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. checksums.yaml +4 -4
  2. data/lib/metasploit/credential/exporter/core.rb +2 -2
  3. data/lib/metasploit/credential/exporter/pwdump.rb +2 -2
  4. data/lib/metasploit/credential/migrator.rb +1 -1
  5. data/lib/metasploit/credential/version.rb +1 -3
  6. data/spec/dummy/config/database.yml +13 -11
  7. data/spec/dummy/db/structure.sql +1 -0
  8. data/spec/lib/metasploit/credential/creation_spec.rb +6 -8
  9. data/spec/lib/metasploit/credential/exporter/core_spec.rb +100 -85
  10. data/spec/lib/metasploit/credential/exporter/pwdump_spec.rb +14 -16
  11. data/spec/lib/metasploit/credential/importer/core_spec.rb +10 -12
  12. data/spec/lib/metasploit/credential/importer/multi_spec.rb +4 -6
  13. data/spec/lib/metasploit/credential/importer/pwdump_spec.rb +11 -13
  14. data/spec/lib/metasploit/credential/importer/zip_spec.rb +5 -7
  15. data/spec/lib/metasploit/credential/migrator_spec.rb +13 -13
  16. data/spec/lib/metasploit/credential/version_spec.rb +3 -5
  17. data/spec/lib/metasploit/credential_spec.rb +1 -3
  18. data/spec/models/mdm/service_spec.rb +3 -5
  19. data/spec/models/mdm/session_spec.rb +2 -4
  20. data/spec/models/mdm/task_spec.rb +4 -6
  21. data/spec/models/mdm/user_spec.rb +2 -4
  22. data/spec/models/mdm/workspace_spec.rb +2 -4
  23. data/spec/models/metasploit/credential/blank_username_spec.rb +5 -7
  24. data/spec/models/metasploit/credential/core_spec.rb +43 -45
  25. data/spec/models/metasploit/credential/login/status_spec.rb +19 -21
  26. data/spec/models/metasploit/credential/login_spec.rb +36 -38
  27. data/spec/models/metasploit/credential/nonreplayable_hash_spec.rb +3 -5
  28. data/spec/models/metasploit/credential/ntlm_hash_spec.rb +13 -15
  29. data/spec/models/metasploit/credential/origin/cracked_password_spec.rb +5 -7
  30. data/spec/models/metasploit/credential/origin/import_spec.rb +8 -10
  31. data/spec/models/metasploit/credential/origin/manual_spec.rb +7 -9
  32. data/spec/models/metasploit/credential/origin/service_spec.rb +10 -12
  33. data/spec/models/metasploit/credential/origin/session_spec.rb +11 -13
  34. data/spec/models/metasploit/credential/password_hash_spec.rb +4 -6
  35. data/spec/models/metasploit/credential/password_spec.rb +3 -5
  36. data/spec/models/metasploit/credential/postgres_md5_spec.rb +4 -6
  37. data/spec/models/metasploit/credential/private_spec.rb +8 -10
  38. data/spec/models/metasploit/credential/public_spec.rb +5 -7
  39. data/spec/models/metasploit/credential/realm_spec.rb +14 -16
  40. data/spec/models/metasploit/credential/replayable_hash_spec.rb +3 -5
  41. data/spec/models/metasploit/credential/ssh_key_spec.rb +15 -17
  42. data/spec/models/metasploit/credential/username_spec.rb +6 -8
  43. data/spec/models/metasploit_data_models/search/visitor/relation_spec.rb +1 -3
  44. data/spec/spec_helper.rb +83 -18
  45. data/spec/support/shared/contexts/mdm/workspace.rb +1 -1
  46. data/spec/support/shared/examples/core_validations.rb +117 -42
  47. data/spec/support/shared/examples/single_table_inheritance_database_columns.rb +2 -2
  48. data/spec/support/shared/examples/timestamp_database_column.rb +2 -2
  49. metadata +9 -9
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Exporter::Pwdump do
1
+ RSpec.describe Metasploit::Credential::Exporter::Pwdump do
4
2
  include_context 'Mdm::Workspace'
5
3
 
6
4
  subject(:exporter){ Metasploit::Credential::Exporter::Pwdump.new}
@@ -13,7 +11,7 @@ describe Metasploit::Credential::Exporter::Pwdump do
13
11
  describe "associated Mdm::Service objects" do
14
12
  it 'should properly format the service information' do
15
13
  service = login.service
16
- exporter.format_service_for_login(login).should == "#{service.host.address}:#{service.port}/#{service.proto} (#{service.name})"
14
+ expect(exporter.format_service_for_login(login)).to eq("#{service.host.address}:#{service.port}/#{service.proto} (#{service.name})")
17
15
  end
18
16
  end
19
17
 
@@ -25,17 +23,17 @@ describe Metasploit::Credential::Exporter::Pwdump do
25
23
  end
26
24
 
27
25
  it 'should have the proper formatting with extant data' do
28
- exporter.format_password(login).should == "#{login.core.public.username} #{login.core.private.data}"
26
+ expect(exporter.format_password(login)).to eq("#{login.core.public.username} #{login.core.private.data}")
29
27
  end
30
28
 
31
29
  it 'should have the proper formatting with a missing public' do
32
30
  login.core.public.username = ""
33
- exporter.format_password(login).should == "#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING} #{login.core.private.data}"
31
+ expect(exporter.format_password(login)).to eq("#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING} #{login.core.private.data}")
34
32
  end
35
33
 
36
34
  it 'should have the proper formatting with a missing private' do
37
35
  login.core.private.data = ""
38
- exporter.format_password(login).should == "#{login.core.public.username} #{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}"
36
+ expect(exporter.format_password(login)).to eq("#{login.core.public.username} #{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}")
39
37
  end
40
38
  end
41
39
 
@@ -47,17 +45,17 @@ describe Metasploit::Credential::Exporter::Pwdump do
47
45
  end
48
46
 
49
47
  it 'should have the proper formatting with extant data' do
50
- exporter.format_nonreplayable_hash(login).should == "#{login.core.public.username}:#{login.core.private.data}:::"
48
+ expect(exporter.format_nonreplayable_hash(login)).to eq("#{login.core.public.username}:#{login.core.private.data}:::")
51
49
  end
52
50
 
53
51
  it 'should have the proper formatting with a missing public' do
54
52
  login.core.public.username = ""
55
- exporter.format_nonreplayable_hash(login).should == "#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.core.private.data}:::"
53
+ expect(exporter.format_nonreplayable_hash(login)).to eq("#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.core.private.data}:::")
56
54
  end
57
55
 
58
56
  it 'should have the proper formatting with a missing private' do
59
57
  login.core.private.data = ""
60
- exporter.format_nonreplayable_hash(login).should == "#{login.core.public.username}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:::"
58
+ expect(exporter.format_nonreplayable_hash(login)).to eq("#{login.core.public.username}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:::")
61
59
  end
62
60
  end
63
61
 
@@ -69,17 +67,17 @@ describe Metasploit::Credential::Exporter::Pwdump do
69
67
  end
70
68
 
71
69
  it 'should have the proper formatting with extant data' do
72
- exporter.format_ntlm_hash(login).should == "#{login.core.public.username}:#{login.id}:#{login.core.private.data}:::"
70
+ expect(exporter.format_ntlm_hash(login)).to eq("#{login.core.public.username}:#{login.id}:#{login.core.private.data}:::")
73
71
  end
74
72
 
75
73
  it 'should have the proper formatting with a missing public' do
76
74
  login.core.public.username = ""
77
- exporter.format_ntlm_hash(login).should == "#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.id}:#{login.core.private.data}:::"
75
+ expect(exporter.format_ntlm_hash(login)).to eq("#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.id}:#{login.core.private.data}:::")
78
76
  end
79
77
 
80
78
  it 'should have the proper formatting with a missing private' do
81
79
  login.core.private.data = ""
82
- exporter.format_ntlm_hash(login).should == "#{login.core.public.username}:#{login.id}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:::"
80
+ expect(exporter.format_ntlm_hash(login)).to eq("#{login.core.public.username}:#{login.id}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:::")
83
81
  end
84
82
  end
85
83
 
@@ -91,17 +89,17 @@ describe Metasploit::Credential::Exporter::Pwdump do
91
89
  end
92
90
 
93
91
  it 'should have the proper formatting with extant data' do
94
- exporter.format_postgres_md5(login).should == "#{login.core.public.username}:#{login.core.private.data}"
92
+ expect(exporter.format_postgres_md5(login)).to eq("#{login.core.public.username}:#{login.core.private.data}")
95
93
  end
96
94
 
97
95
  it 'should have the proper formatting with a missing public' do
98
96
  login.core.public.username = ""
99
- exporter.format_postgres_md5(login).should == "#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.core.private.data}"
97
+ expect(exporter.format_postgres_md5(login)).to eq("#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}:#{login.core.private.data}")
100
98
  end
101
99
 
102
100
  it 'should have the proper formatting with a missing private' do
103
101
  login.core.private.data = ""
104
- exporter.format_postgres_md5(login).should == "#{login.core.public.username}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}"
102
+ expect(exporter.format_postgres_md5(login)).to eq("#{login.core.public.username}:#{Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING}")
105
103
  end
106
104
 
107
105
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Importer::Core do
1
+ RSpec.describe Metasploit::Credential::Importer::Core do
4
2
  include_context 'Mdm::Workspace'
5
3
  let(:workspace){FactoryGirl.create(:mdm_workspace)}
6
4
 
@@ -19,7 +17,7 @@ describe Metasploit::Credential::Importer::Core do
19
17
  core_csv_importer.private_credential_type = "Metasploit::Credential::Password"
20
18
  end
21
19
 
22
- it { should be_valid }
20
+ it { is_expected.to be_valid }
23
21
  end
24
22
 
25
23
  describe "with a non-supported credential type" do
@@ -36,7 +34,7 @@ describe Metasploit::Credential::Importer::Core do
36
34
 
37
35
  it 'should report the error being invalid private type' do
38
36
  core_csv_importer.valid?
39
- core_csv_importer.errors[:private_credential_type].should include error
37
+ expect(core_csv_importer.errors[:private_credential_type]).to include error
40
38
  end
41
39
  end
42
40
 
@@ -54,7 +52,7 @@ describe Metasploit::Credential::Importer::Core do
54
52
 
55
53
  it 'should report the error being invalid headers' do
56
54
  core_csv_importer.valid?
57
- core_csv_importer.errors[:input].should include error
55
+ expect(core_csv_importer.errors[:input]).to include error
58
56
  end
59
57
  end
60
58
  end
@@ -62,7 +60,7 @@ describe Metasploit::Credential::Importer::Core do
62
60
  describe "long-form imports" do
63
61
  describe "with well-formed CSV data" do
64
62
  describe "with a compliant header" do
65
- it { should be_valid }
63
+ it { is_expected.to be_valid }
66
64
  end
67
65
 
68
66
  describe "with data that includes a missing Public (username)" do
@@ -127,7 +125,7 @@ describe Metasploit::Credential::Importer::Core do
127
125
 
128
126
  it 'should report the error being incorrect headers' do
129
127
  core_csv_importer.valid?
130
- core_csv_importer.errors[:input].should include error
128
+ expect(core_csv_importer.errors[:input]).to include error
131
129
  end
132
130
  end
133
131
 
@@ -140,11 +138,11 @@ describe Metasploit::Credential::Importer::Core do
140
138
  core_csv_importer.input = FactoryGirl.generate(:malformed_csv)
141
139
  end
142
140
 
143
- it { should be_invalid }
141
+ it { is_expected.to be_invalid }
144
142
 
145
143
  it 'should report the error being malformed CSV' do
146
144
  core_csv_importer.valid?
147
- core_csv_importer.errors[:input].should include error
145
+ expect(core_csv_importer.errors[:input]).to include error
148
146
  end
149
147
  end
150
148
 
@@ -157,11 +155,11 @@ describe Metasploit::Credential::Importer::Core do
157
155
  core_csv_importer.input = FactoryGirl.generate(:empty_core_csv)
158
156
  end
159
157
 
160
- it { should be_invalid }
158
+ it { is_expected.to be_invalid }
161
159
 
162
160
  it 'should show the proper error message' do
163
161
  core_csv_importer.valid?
164
- core_csv_importer.errors[:input].should include error
162
+ expect(core_csv_importer.errors[:input]).to include error
165
163
  end
166
164
  end
167
165
 
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Importer::Multi do
1
+ RSpec.describe Metasploit::Credential::Importer::Multi do
4
2
  include_context 'Mdm::Workspace'
5
3
  include_context 'metasploit_credential_importer_zip_file'
6
4
 
@@ -31,7 +29,7 @@ describe Metasploit::Credential::Importer::Multi do
31
29
  context "when given zip file" do
32
30
  subject(:multi_importer){ Metasploit::Credential::Importer::Multi.new(input: File.open(supported_file), origin: import_origin)}
33
31
 
34
- it { should be_valid }
32
+ it { is_expected.to be_valid }
35
33
  end
36
34
 
37
35
  describe "#csv?" do
@@ -39,7 +37,7 @@ describe Metasploit::Credential::Importer::Multi do
39
37
  subject(:multi_importer){ Metasploit::Credential::Importer::Multi.new(input: File.open(valid_csv_file), origin: import_origin)}
40
38
 
41
39
  it 'should return true' do
42
- multi_importer.csv?.should be_true
40
+ expect(multi_importer.csv?).to eq(true)
43
41
  end
44
42
  end
45
43
 
@@ -47,7 +45,7 @@ describe Metasploit::Credential::Importer::Multi do
47
45
  subject(:multi_importer){ Metasploit::Credential::Importer::Multi.new(input: File.open(unsupported_file), origin: import_origin)}
48
46
 
49
47
  it 'should return true' do
50
- multi_importer.csv?.should be_false
48
+ expect(multi_importer.csv?).to eq(false)
51
49
  end
52
50
  end
53
51
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Importer::Pwdump do
1
+ RSpec.describe Metasploit::Credential::Importer::Pwdump do
4
2
  include_context 'Mdm::Workspace'
5
3
 
6
4
  let(:workspace) {FactoryGirl.create(:mdm_workspace)}
@@ -11,12 +9,12 @@ describe Metasploit::Credential::Importer::Pwdump do
11
9
  origin: origin)}
12
10
 
13
11
  describe "validation" do
14
- it { should be_valid }
12
+ it { is_expected.to be_valid }
15
13
 
16
14
  describe "without a filename" do
17
15
  it 'should not be valid' do
18
16
  pwdump_importer.filename = nil
19
- pwdump_importer.should_not be_valid
17
+ expect(pwdump_importer).not_to be_valid
20
18
  end
21
19
  end
22
20
  end
@@ -24,32 +22,32 @@ describe Metasploit::Credential::Importer::Pwdump do
24
22
  describe "#blank_or_string" do
25
23
  context "with a blank string" do
26
24
  it 'should return empty string' do
27
- pwdump_importer.blank_or_string("").should == ""
25
+ expect(pwdump_importer.blank_or_string("")).to eq("")
28
26
  end
29
27
  end
30
28
  context "with a BLANK_CRED_STRING" do
31
29
  it 'should return empty string' do
32
- pwdump_importer.blank_or_string(Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING).should == ""
30
+ expect(pwdump_importer.blank_or_string(Metasploit::Credential::Exporter::Pwdump::BLANK_CRED_STRING)).to eq("")
33
31
  end
34
32
  end
35
33
 
36
34
  context "with a JTR_NO_PASSWORD_STRING" do
37
35
  it 'should return empty string' do
38
- pwdump_importer.blank_or_string(Metasploit::Credential::Importer::Pwdump::JTR_NO_PASSWORD_STRING).should == ""
36
+ expect(pwdump_importer.blank_or_string(Metasploit::Credential::Importer::Pwdump::JTR_NO_PASSWORD_STRING)).to eq("")
39
37
  end
40
38
  end
41
39
 
42
40
  context "with a present string" do
43
41
  it 'should return the string' do
44
42
  string = "mah-hard-passwerd"
45
- pwdump_importer.blank_or_string(string).should == string
43
+ expect(pwdump_importer.blank_or_string(string)).to eq(string)
46
44
  end
47
45
  end
48
46
 
49
47
  context "with the dehex flag" do
50
48
  it 'should dehex the string with the Metasploit::Credential::Text#dehex method' do
51
49
  string = "mah-hard-passwerd"
52
- Metasploit::Credential::Text.should_receive(:dehex).with string
50
+ expect(Metasploit::Credential::Text).to receive(:dehex).with string
53
51
  pwdump_importer.blank_or_string(string, true)
54
52
  end
55
53
  end
@@ -64,8 +62,8 @@ describe Metasploit::Credential::Importer::Pwdump do
64
62
  it 'should create Cores with the same Origin' do
65
63
  pwdump_importer.import!
66
64
  origins = Metasploit::Credential::Core.all.collect(&:origin).uniq
67
- origins.size.should be(1)
68
- origins.first.id.should be(origin.id)
65
+ expect(origins.size).to be(1)
66
+ expect(origins.first.id).to be(origin.id)
69
67
  end
70
68
 
71
69
  it 'should create the proper number of Logins' do
@@ -96,7 +94,7 @@ describe Metasploit::Credential::Importer::Pwdump do
96
94
  # Legacy files may have these lines when missing SSH key files
97
95
  it 'should not create a Private from a "Warning" line' do
98
96
  pwdump_importer.import!
99
- Metasploit::Credential::Private.where(data:'missing').should be_blank
97
+ expect(Metasploit::Credential::Private.where(data:'missing')).to be_blank
100
98
  end
101
99
  end
102
100
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Importer::Zip do
1
+ RSpec.describe Metasploit::Credential::Importer::Zip do
4
2
  include_context 'Mdm::Workspace'
5
3
  include_context 'metasploit_credential_importer_zip_file'
6
4
 
@@ -11,7 +9,7 @@ describe Metasploit::Credential::Importer::Zip do
11
9
  DUMMY_ZIP_PATH = "/tmp/import-test-dummy.zip"
12
10
 
13
11
  context "when the zip file contains a keys directory and a manifest CSV" do
14
- it { should be_valid }
12
+ it { is_expected.to be_valid }
15
13
  end
16
14
 
17
15
  context "when the zip file is not actually an archive" do
@@ -32,7 +30,7 @@ describe Metasploit::Credential::Importer::Zip do
32
30
 
33
31
  it 'should show the proper error message' do
34
32
  zip_importer.valid?
35
- zip_importer.errors[:input].should include error
33
+ expect(zip_importer.errors[:input]).to include error
36
34
  end
37
35
  end
38
36
 
@@ -49,7 +47,7 @@ describe Metasploit::Credential::Importer::Zip do
49
47
 
50
48
  it 'should show the proper error message' do
51
49
  zip_importer.valid?
52
- zip_importer.errors[:input].should include error
50
+ expect(zip_importer.errors[:input]).to include error
53
51
  end
54
52
  end
55
53
 
@@ -63,7 +61,7 @@ describe Metasploit::Credential::Importer::Zip do
63
61
 
64
62
  describe "zip constants" do
65
63
  it 'should have ZIP_HEADER_IDENTIFIER whose length corresponds to ZIP_HEADER_BYTE_LENGTH' do
66
- Metasploit::Credential::Importer::Zip::ZIP_HEADER_IDENTIFIER.size.should == Metasploit::Credential::Importer::Zip::ZIP_HEADER_BYTE_LENGTH
64
+ expect(Metasploit::Credential::Importer::Zip::ZIP_HEADER_IDENTIFIER.size).to eq(Metasploit::Credential::Importer::Zip::ZIP_HEADER_BYTE_LENGTH)
67
65
  end
68
66
  end
69
67
  end
@@ -1,7 +1,7 @@
1
1
  require 'spec_helper'
2
2
  require 'tempfile'
3
3
 
4
- describe Metasploit::Credential::Migrator do
4
+ RSpec.describe Metasploit::Credential::Migrator do
5
5
  include_context 'Mdm::Workspace'
6
6
 
7
7
  let(:workspace){ FactoryGirl.create(:mdm_workspace) }
@@ -62,9 +62,9 @@ describe Metasploit::Credential::Migrator do
62
62
  end
63
63
 
64
64
  it "should be created for each Mdm::Cred" do
65
- Metasploit::Credential::Public.where(username: cred1.user).should_not be_blank
66
- Metasploit::Credential::Public.where(username: cred2.user).should_not be_blank
67
- Metasploit::Credential::Public.where(username: cred3.user).should_not be_blank
65
+ expect(Metasploit::Credential::Public.where(username: cred1.user)).not_to be_blank
66
+ expect(Metasploit::Credential::Public.where(username: cred2.user)).not_to be_blank
67
+ expect(Metasploit::Credential::Public.where(username: cred3.user)).not_to be_blank
68
68
  end
69
69
  end
70
70
 
@@ -75,9 +75,9 @@ describe Metasploit::Credential::Migrator do
75
75
 
76
76
  it "should be created for each Mdm::Cred" do
77
77
  migrator.convert_creds_in_workspace(workspace)
78
- Metasploit::Credential::Password.where(data: cred1.pass).should_not be_blank
79
- Metasploit::Credential::Password.where(data: cred2.pass).should_not be_blank
80
- Metasploit::Credential::Password.where(data: cred3.pass).should_not be_blank
78
+ expect(Metasploit::Credential::Password.where(data: cred1.pass)).not_to be_blank
79
+ expect(Metasploit::Credential::Password.where(data: cred2.pass)).not_to be_blank
80
+ expect(Metasploit::Credential::Password.where(data: cred3.pass)).not_to be_blank
81
81
  end
82
82
  end
83
83
  end
@@ -97,7 +97,7 @@ describe Metasploit::Credential::Migrator do
97
97
  end
98
98
 
99
99
  it 'should create a new NTLMHash in the database' do
100
- Metasploit::Credential::NTLMHash.where(data: cred.pass).should_not be_blank
100
+ expect(Metasploit::Credential::NTLMHash.where(data: cred.pass)).not_to be_blank
101
101
  end
102
102
  end
103
103
 
@@ -126,7 +126,7 @@ describe Metasploit::Credential::Migrator do
126
126
  end
127
127
 
128
128
  it 'should create a new SSHKey in the database' do
129
- Metasploit::Credential::SSHKey.where(data: ssh_key_content).should_not be_blank
129
+ expect(Metasploit::Credential::SSHKey.where(data: ssh_key_content)).not_to be_blank
130
130
  end
131
131
  end
132
132
 
@@ -144,7 +144,7 @@ describe Metasploit::Credential::Migrator do
144
144
  end
145
145
 
146
146
  it 'should create a new SSHKey in the database' do
147
- Metasploit::Credential::SSHKey.where(data: ssh_key_content).should_not be_blank
147
+ expect(Metasploit::Credential::SSHKey.where(data: ssh_key_content)).not_to be_blank
148
148
  end
149
149
  end
150
150
 
@@ -162,7 +162,7 @@ describe Metasploit::Credential::Migrator do
162
162
  end
163
163
 
164
164
  it 'should not create a new SSHKey in the database' do
165
- Metasploit::Credential::SSHKey.count.should be_zero
165
+ expect(Metasploit::Credential::SSHKey.count).to be_zero
166
166
  end
167
167
  end
168
168
 
@@ -182,7 +182,7 @@ describe Metasploit::Credential::Migrator do
182
182
  end
183
183
 
184
184
  it 'should create a new Password in the database' do
185
- Metasploit::Credential::Password.where(data: cred.pass).should_not be_blank
185
+ expect(Metasploit::Credential::Password.where(data: cred.pass)).not_to be_blank
186
186
  end
187
187
  end
188
188
 
@@ -200,7 +200,7 @@ describe Metasploit::Credential::Migrator do
200
200
  end
201
201
 
202
202
  it 'should create a new NonreplayableHash in the database' do
203
- Metasploit::Credential::NonreplayableHash.where(data: cred.pass).should_not be_blank
203
+ expect(Metasploit::Credential::NonreplayableHash.where(data: cred.pass)).not_to be_blank
204
204
  end
205
205
  end
206
206
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential::Version do
1
+ RSpec.describe Metasploit::Credential::Version do
4
2
  context 'CONSTANTS' do
5
3
  context 'MAJOR' do
6
4
  subject(:major) do
@@ -17,7 +15,7 @@ describe Metasploit::Credential::Version do
17
15
  described_class::MINOR
18
16
  end
19
17
 
20
- it { should be_a Integer }
18
+ it { is_expected.to be_a Integer }
21
19
  end
22
20
 
23
21
  context 'PATCH' do
@@ -25,7 +23,7 @@ describe Metasploit::Credential::Version do
25
23
  described_class::PATCH
26
24
  end
27
25
 
28
- it { should be_a Integer }
26
+ it { is_expected.to be_a Integer }
29
27
  end
30
28
 
31
29
  pull_request = ENV['TRAVIS_PULL_REQUEST']
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe Metasploit::Credential do
1
+ RSpec.describe Metasploit::Credential do
4
2
  context 'CONSTANTS' do
5
3
  context 'VERSION' do
6
4
  subject(:version) do