metasploit_data_models 0.24.0 → 0.24.1.pre.rspec.pre.3.pre.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (100) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +3 -3
  3. data/Gemfile +1 -3
  4. data/app/models/metasploit_data_models/ip_address/v4/segmented.rb +1 -1
  5. data/app/models/metasploit_data_models/search/visitor/where.rb +1 -1
  6. data/app/validators/password_is_strong_validator.rb +1 -1
  7. data/lib/mdm/host/operating_system_normalization.rb +0 -10
  8. data/lib/metasploit_data_models/version.rb +2 -2
  9. data/metasploit_data_models.gemspec +1 -1
  10. data/spec/app/models/mdm/api_key_spec.rb +1 -3
  11. data/spec/app/models/mdm/client_spec.rb +9 -11
  12. data/spec/app/models/mdm/cred_spec.rb +42 -54
  13. data/spec/app/models/mdm/event_spec.rb +21 -23
  14. data/spec/app/models/mdm/exploit_attempt_spec.rb +19 -21
  15. data/spec/app/models/mdm/exploited_host_spec.rb +11 -13
  16. data/spec/app/models/mdm/host_detail_spec.rb +15 -17
  17. data/spec/app/models/mdm/host_spec.rb +261 -260
  18. data/spec/app/models/mdm/host_tag_spec.rb +6 -8
  19. data/spec/app/models/mdm/listener_spec.rb +30 -32
  20. data/spec/app/models/mdm/loot_spec.rb +21 -23
  21. data/spec/app/models/mdm/macro_spec.rb +1 -3
  22. data/spec/app/models/mdm/mod_ref_spec.rb +1 -3
  23. data/spec/app/models/mdm/module/action_spec.rb +10 -12
  24. data/spec/app/models/mdm/module/arch_spec.rb +10 -12
  25. data/spec/app/models/mdm/module/author_spec.rb +22 -17
  26. data/spec/app/models/mdm/module/detail_spec.rb +184 -75
  27. data/spec/app/models/mdm/module/mixin_spec.rb +10 -12
  28. data/spec/app/models/mdm/module/platform_spec.rb +10 -12
  29. data/spec/app/models/mdm/module/ref_spec.rb +10 -12
  30. data/spec/app/models/mdm/module/target_spec.rb +13 -15
  31. data/spec/app/models/mdm/nexpose_console_spec.rb +35 -37
  32. data/spec/app/models/mdm/note_spec.rb +23 -25
  33. data/spec/app/models/mdm/profile_spec.rb +1 -3
  34. data/spec/app/models/mdm/ref_spec.rb +10 -12
  35. data/spec/app/models/mdm/route_spec.rb +6 -8
  36. data/spec/app/models/mdm/service_spec.rb +38 -40
  37. data/spec/app/models/mdm/session_event_spec.rb +10 -12
  38. data/spec/app/models/mdm/session_spec.rb +13 -15
  39. data/spec/app/models/mdm/tag_spec.rb +29 -29
  40. data/spec/app/models/mdm/task_cred_spec.rb +9 -11
  41. data/spec/app/models/mdm/task_host_spec.rb +9 -11
  42. data/spec/app/models/mdm/task_service_spec.rb +9 -11
  43. data/spec/app/models/mdm/task_session_spec.rb +7 -9
  44. data/spec/app/models/mdm/task_spec.rb +27 -29
  45. data/spec/app/models/mdm/user_spec.rb +17 -19
  46. data/spec/app/models/mdm/vuln_attempt_spec.rb +14 -16
  47. data/spec/app/models/mdm/vuln_detail_spec.rb +26 -28
  48. data/spec/app/models/mdm/vuln_ref_spec.rb +8 -10
  49. data/spec/app/models/mdm/vuln_spec.rb +24 -26
  50. data/spec/app/models/mdm/web_form_spec.rb +11 -13
  51. data/spec/app/models/mdm/web_page_spec.rb +19 -21
  52. data/spec/app/models/mdm/web_site_spec.rb +21 -23
  53. data/spec/app/models/mdm/web_vuln_spec.rb +63 -65
  54. data/spec/app/models/mdm/wmap_request_spec.rb +1 -3
  55. data/spec/app/models/mdm/wmap_target_spec.rb +1 -3
  56. data/spec/app/models/mdm/workspace_spec.rb +97 -100
  57. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_result_spec.rb +3 -5
  58. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_set_spec.rb +13 -15
  59. data/spec/app/models/metasploit_data_models/automatic_exploitation/match_spec.rb +1 -3
  60. data/spec/app/models/metasploit_data_models/automatic_exploitation/run_spec.rb +1 -3
  61. data/spec/app/models/metasploit_data_models/ip_address/v4/cidr_spec.rb +10 -12
  62. data/spec/app/models/metasploit_data_models/ip_address/v4/nmap_spec.rb +4 -6
  63. data/spec/app/models/metasploit_data_models/ip_address/v4/range_spec.rb +21 -23
  64. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/list_spec.rb +9 -11
  65. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/nmap/range_spec.rb +21 -23
  66. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/segmented_spec.rb +4 -6
  67. data/spec/app/models/metasploit_data_models/ip_address/v4/segment/single_spec.rb +22 -15
  68. data/spec/app/models/metasploit_data_models/ip_address/v4/single_spec.rb +4 -6
  69. data/spec/app/models/metasploit_data_models/module_run_spec.rb +1 -3
  70. data/spec/app/models/metasploit_data_models/search/operation/ip_address_spec.rb +18 -20
  71. data/spec/app/models/metasploit_data_models/search/operation/port/number_spec.rb +6 -8
  72. data/spec/app/models/metasploit_data_models/search/operation/port/range_spec.rb +8 -10
  73. data/spec/app/models/metasploit_data_models/search/operation/range_spec.rb +8 -10
  74. data/spec/app/models/metasploit_data_models/search/operator/ip_address_spec.rb +2 -4
  75. data/spec/app/models/metasploit_data_models/search/operator/multitext_spec.rb +8 -10
  76. data/spec/app/models/metasploit_data_models/search/operator/port/list_spec.rb +6 -8
  77. data/spec/app/models/metasploit_data_models/search/visitor/attribute_spec.rb +9 -11
  78. data/spec/app/models/metasploit_data_models/search/visitor/includes_spec.rb +5 -7
  79. data/spec/app/models/metasploit_data_models/search/visitor/joins_spec.rb +17 -19
  80. data/spec/app/models/metasploit_data_models/search/visitor/method_spec.rb +5 -7
  81. data/spec/app/models/metasploit_data_models/search/visitor/relation_spec.rb +61 -23
  82. data/spec/app/models/metasploit_data_models/search/visitor/where_spec.rb +8 -10
  83. data/spec/app/validators/parameters_validator_spec.rb +29 -29
  84. data/spec/app/validators/password_is_strong_validator_spec.rb +54 -46
  85. data/spec/dummy/db/structure.sql +1 -0
  86. data/spec/lib/base64_serializer_spec.rb +19 -19
  87. data/spec/lib/metasploit_data_models/ip_address/cidr_spec.rb +18 -12
  88. data/spec/lib/metasploit_data_models/ip_address/range_spec.rb +4 -6
  89. data/spec/lib/metasploit_data_models/match/child_spec.rb +2 -4
  90. data/spec/lib/metasploit_data_models/match/parent_spec.rb +4 -6
  91. data/spec/lib/metasploit_data_models/version_spec.rb +3 -5
  92. data/spec/spec_helper.rb +72 -6
  93. data/spec/support/shared/examples/mdm/module/detail/does_not_support_stance_with_mtype.rb +2 -2
  94. data/spec/support/shared/examples/mdm/module/detail/supports_stance_with_mtype.rb +4 -4
  95. data/spec/support/shared/examples/metasploit_data_models/search/operation/ipaddress/match.rb +2 -2
  96. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_children.rb +5 -5
  97. data/spec/support/shared/examples/metasploit_data_models/search/visitor/includes/visit/with_metasploit_model_search_operation_base.rb +5 -5
  98. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_equality.rb +3 -3
  99. data/spec/support/shared/examples/metasploit_data_models/search/visitor/where/visit/with_metasploit_model_search_group_base.rb +7 -6
  100. metadata +6 -6
@@ -1,13 +1,11 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::IPAddress::V4::Segmented do
1
+ RSpec.describe MetasploitDataModels::IPAddress::V4::Segmented, type: :model do
4
2
  context 'CONSTANTS' do
5
3
  context 'SEGMENT_COUNT' do
6
4
  subject(:segment_count) {
7
5
  described_class::SEGMENT_COUNT
8
6
  }
9
7
 
10
- it { should == 4 }
8
+ it { is_expected.to eq(4) }
11
9
  end
12
10
 
13
11
  context 'SEPARATOR' do
@@ -15,7 +13,7 @@ describe MetasploitDataModels::IPAddress::V4::Segmented do
15
13
  described_class::SEPARATOR
16
14
  }
17
15
 
18
- it { should == '.' }
16
+ it { is_expected.to eq('.') }
19
17
  end
20
18
  end
21
19
 
@@ -24,6 +22,6 @@ describe MetasploitDataModels::IPAddress::V4::Segmented do
24
22
  described_class.segment_count
25
23
  }
26
24
 
27
- it { should == 4 }
25
+ it { is_expected.to eq(4) }
28
26
  end
29
27
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::IPAddress::V4::Segment::Single do
1
+ RSpec.describe MetasploitDataModels::IPAddress::V4::Segment::Single, type: :model do
4
2
  subject(:single) {
5
3
  described_class.new(
6
4
  value: formatted_value
@@ -12,7 +10,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
12
10
  }
13
11
 
14
12
  context 'validations' do
15
- it { should validate_numericality_of(:value).is_greater_than_or_equal_to(0).is_less_than_or_equal_to(255).only_integer }
13
+ it { is_expected.to validate_numericality_of(:value).is_greater_than_or_equal_to(0).is_less_than_or_equal_to(255).only_integer }
16
14
  end
17
15
 
18
16
  it 'can be used in a Range' do
@@ -137,7 +135,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
137
135
  described_class.bits
138
136
  }
139
137
 
140
- it { should == 8 }
138
+ it { is_expected.to eq(8) }
141
139
  end
142
140
 
143
141
  context 'match_regexp' do
@@ -159,15 +157,22 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
159
157
  single <=> other
160
158
  }
161
159
 
160
+ let(:formatted_value) {
161
+ '1'
162
+ }
163
+
162
164
  let(:other) {
163
165
  double('Other')
164
166
  }
165
167
 
166
168
  it 'compares #values' do
167
169
  other_value = double('other.value')
170
+ single_value = double('single.value')
168
171
 
169
172
  expect(other).to receive(:value).and_return(other_value)
170
- expect(single.value).to receive(:<=>).with(other_value)
173
+ # have to use a double because can't expect().to receive on an Integer
174
+ expect(single).to receive(:value).and_return(single_value)
175
+ expect(single_value).to receive(:<=>).with(other_value)
171
176
 
172
177
  compare
173
178
  end
@@ -185,7 +190,9 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
185
190
  }
186
191
 
187
192
  specify {
188
- expect(succ).not_to raise_error
193
+ expect {
194
+ succ
195
+ }.not_to raise_error
189
196
  }
190
197
  end
191
198
 
@@ -198,7 +205,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
198
205
  1
199
206
  }
200
207
 
201
- it { should be_a described_class }
208
+ it { is_expected.to be_a described_class }
202
209
 
203
210
  context 'succ.value' do
204
211
  it 'is succ of #value' do
@@ -212,7 +219,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
212
219
  'a'
213
220
  }
214
221
 
215
- it { should be_a described_class }
222
+ it { is_expected.to be_a described_class }
216
223
 
217
224
  context 'succ.value' do
218
225
  it 'is succ of #value' do
@@ -262,7 +269,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
262
269
  end
263
270
 
264
271
  it 'should pass through Integer' do
265
- value.should == formatted_value
272
+ expect(value).to eq(formatted_value)
266
273
  end
267
274
  end
268
275
 
@@ -276,7 +283,7 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
276
283
  end
277
284
 
278
285
  it 'should convert String to Integer' do
279
- value.should == integer
286
+ expect(value).to eq(integer)
280
287
  end
281
288
  end
282
289
 
@@ -290,11 +297,11 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
290
297
  end
291
298
 
292
299
  it 'should not extract the number' do
293
- value.should_not == integer
300
+ expect(value).not_to eq(integer)
294
301
  end
295
302
 
296
303
  it 'should pass through the full value' do
297
- value.should == formatted_value
304
+ expect(value).to eq(formatted_value)
298
305
  end
299
306
  end
300
307
 
@@ -304,11 +311,11 @@ describe MetasploitDataModels::IPAddress::V4::Segment::Single do
304
311
  end
305
312
 
306
313
  it 'should not truncate Float to Integer' do
307
- value.should_not == formatted_value.to_i
314
+ expect(value).not_to eq(formatted_value.to_i)
308
315
  end
309
316
 
310
317
  it 'should pass through Float' do
311
- value.should == formatted_value
318
+ expect(value).to eq(formatted_value)
312
319
  end
313
320
  end
314
321
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::IPAddress::V4::Single do
1
+ RSpec.describe MetasploitDataModels::IPAddress::V4::Single, type: :model do
4
2
  subject(:single) {
5
3
  described_class.new(
6
4
  value: formatted_value
@@ -22,7 +20,7 @@ describe MetasploitDataModels::IPAddress::V4::Single do
22
20
  '1.2.3.4'
23
21
  }
24
22
 
25
- it { should be_empty }
23
+ it { is_expected.to be_empty }
26
24
  end
27
25
 
28
26
  context 'without segments' do
@@ -37,7 +35,7 @@ describe MetasploitDataModels::IPAddress::V4::Single do
37
35
  )
38
36
  }
39
37
 
40
- it { should include length_error }
38
+ it { is_expected.to include length_error }
41
39
  end
42
40
  end
43
41
  end
@@ -142,7 +140,7 @@ describe MetasploitDataModels::IPAddress::V4::Single do
142
140
  nil
143
141
  }
144
142
 
145
- it { should be_nil }
143
+ it { is_expected.to be_nil }
146
144
  end
147
145
 
148
146
  context 'with matching formatted value' do
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::ModuleRun do
1
+ RSpec.describe MetasploitDataModels::ModuleRun, type: :model do
4
2
 
5
3
  subject(:module_run){FactoryGirl.build(:metasploit_data_models_module_run)}
6
4
 
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::Search::Operation::IPAddress do
1
+ RSpec.describe MetasploitDataModels::Search::Operation::IPAddress, type: :model do
4
2
  subject(:operation) {
5
3
  described_class.new(
6
4
  operator: operator,
@@ -45,7 +43,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
45
43
  '1.2.3.4/8'
46
44
  }
47
45
 
48
- it { should be_empty }
46
+ it { is_expected.to be_empty }
49
47
  end
50
48
 
51
49
  context 'without valid prefix_length' do
@@ -53,17 +51,17 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
53
51
  '1.2.3.4/36'
54
52
  }
55
53
 
56
- it { should include invalid_error }
54
+ it { is_expected.to include invalid_error }
57
55
  end
58
56
  end
59
57
 
60
- context 'with Nmap', pending: 'MSP-10712' do
61
- context 'with valid segment range' do
58
+ context 'with Nmap' do
59
+ context 'with valid segment range', pending: 'MSP-10712' do
62
60
  let(:formatted_value) {
63
61
  '1-2.3.4.5'
64
62
  }
65
63
 
66
- it { should be_empty }
64
+ it { is_expected.to be_empty }
67
65
  end
68
66
 
69
67
  context 'without valid segment range' do
@@ -71,7 +69,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
71
69
  '2-1.3.4.5'
72
70
  }
73
71
 
74
- it { should include invalid_error }
72
+ it { is_expected.to include invalid_error }
75
73
  end
76
74
  end
77
75
 
@@ -81,7 +79,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
81
79
  '2.2.2.2-1.1.1.1'
82
80
  }
83
81
 
84
- it { should include invalid_error }
82
+ it { is_expected.to include invalid_error }
85
83
  end
86
84
 
87
85
  context 'without ordered range' do
@@ -89,7 +87,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
89
87
  '1.1.1.1-2.2.2.2'
90
88
  }
91
89
 
92
- it { should be_empty }
90
+ it { is_expected.to be_empty }
93
91
  end
94
92
  end
95
93
 
@@ -107,8 +105,8 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
107
105
  nil
108
106
  }
109
107
 
110
- it { should include blank_error }
111
- it { should_not include invalid_error }
108
+ it { is_expected.to include blank_error }
109
+ it { is_expected.not_to include invalid_error }
112
110
  end
113
111
 
114
112
  context 'with empty string' do
@@ -116,8 +114,8 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
116
114
  ''
117
115
  }
118
116
 
119
- it { should include blank_error }
120
- it { should_not include invalid_error }
117
+ it { is_expected.to include blank_error }
118
+ it { is_expected.not_to include invalid_error }
121
119
  end
122
120
 
123
121
  context 'without matching formatted value' do
@@ -125,7 +123,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
125
123
  'non_matching_value'
126
124
  }
127
125
 
128
- it { should include invalid_error }
126
+ it { is_expected.to include invalid_error }
129
127
  end
130
128
  end
131
129
  end
@@ -141,7 +139,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
141
139
  '1.2.3.4/8'
142
140
  }
143
141
 
144
- it { should be_a MetasploitDataModels::IPAddress::V4::CIDR }
142
+ it { is_expected.to be_a MetasploitDataModels::IPAddress::V4::CIDR }
145
143
  end
146
144
 
147
145
  context 'with Nmap', pending: 'MSP-10712' do
@@ -149,7 +147,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
149
147
  '1.2.3.4-5'
150
148
  }
151
149
 
152
- it { should be_a MetasploitDataModels::IPAddress::V4::Nmap }
150
+ it { is_expected.to be_a MetasploitDataModels::IPAddress::V4::Nmap }
153
151
  end
154
152
 
155
153
  context 'with Range' do
@@ -157,7 +155,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
157
155
  '1.1.1.1-2.2.2.2'
158
156
  }
159
157
 
160
- it { should be_a MetasploitDataModels::IPAddress::V4::Range }
158
+ it { is_expected.to be_a MetasploitDataModels::IPAddress::V4::Range }
161
159
  end
162
160
 
163
161
  context 'with address' do
@@ -165,7 +163,7 @@ describe MetasploitDataModels::Search::Operation::IPAddress do
165
163
  '1.2.3.4'
166
164
  }
167
165
 
168
- it { should be_a MetasploitDataModels::IPAddress::V4::Single }
166
+ it { is_expected.to be_a MetasploitDataModels::IPAddress::V4::Single }
169
167
  end
170
168
  end
171
169
 
@@ -1,13 +1,11 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::Search::Operation::Port::Number do
1
+ RSpec.describe MetasploitDataModels::Search::Operation::Port::Number, type: :model do
4
2
  context 'CONSTANTS' do
5
3
  context 'BITS' do
6
4
  subject(:bits) {
7
5
  described_class::BITS
8
6
  }
9
7
 
10
- it { should == 16 }
8
+ it { is_expected.to eq(16) }
11
9
  end
12
10
 
13
11
  context 'MAXIMUM' do
@@ -15,7 +13,7 @@ describe MetasploitDataModels::Search::Operation::Port::Number do
15
13
  described_class::MAXIMUM
16
14
  }
17
15
 
18
- it { should == 65535 }
16
+ it { is_expected.to eq(65535) }
19
17
  end
20
18
 
21
19
  context 'MINIMUM' do
@@ -23,7 +21,7 @@ describe MetasploitDataModels::Search::Operation::Port::Number do
23
21
  described_class::MINIMUM
24
22
  }
25
23
 
26
- it { should == 0 }
24
+ it { is_expected.to eq(0) }
27
25
  end
28
26
 
29
27
  context 'RANGE' do
@@ -31,11 +29,11 @@ describe MetasploitDataModels::Search::Operation::Port::Number do
31
29
  described_class::RANGE
32
30
  }
33
31
 
34
- it { should == (0..65535) }
32
+ it { is_expected.to eq((0..65535)) }
35
33
  end
36
34
  end
37
35
 
38
36
  context 'validations' do
39
- it { should ensure_inclusion_of(:value).in_range(described_class::RANGE) }
37
+ it { is_expected.to ensure_inclusion_of(:value).in_range(described_class::RANGE) }
40
38
  end
41
39
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::Search::Operation::Port::Range do
1
+ RSpec.describe MetasploitDataModels::Search::Operation::Port::Range, type: :model do
4
2
  subject(:port_range_operation) {
5
3
  described_class.new(
6
4
  value: formatted_value
@@ -11,7 +9,7 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
11
9
  '1'
12
10
  }
13
11
 
14
- it { should be_a MetasploitDataModels::Search::Operation::Range }
12
+ it { is_expected.to be_a MetasploitDataModels::Search::Operation::Range }
15
13
 
16
14
  context 'validations' do
17
15
  before(:each) do
@@ -30,7 +28,7 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
30
28
  '1-2'
31
29
  }
32
30
 
33
- it { should be_empty }
31
+ it { is_expected.to be_empty }
34
32
  end
35
33
 
36
34
  # this can't actually happen because the minimum is 0 and a negative number can't be parsed, but validation
@@ -64,7 +62,7 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
64
62
  1
65
63
  }
66
64
 
67
- it { should include error }
65
+ it { is_expected.to include error }
68
66
  end
69
67
 
70
68
  context 'without Range#begin covered by MetasploitDataModels::Search::Operation::Port::Number::RANGE' do
@@ -86,7 +84,7 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
86
84
  MetasploitDataModels::Search::Operation::Port::Number::MAXIMUM + 1
87
85
  }
88
86
 
89
- it { should include error }
87
+ it { is_expected.to include error }
90
88
  end
91
89
  end
92
90
 
@@ -119,8 +117,8 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
119
117
  'b'
120
118
  }
121
119
 
122
- it { should include begin_error }
123
- it { should include end_error }
120
+ it { is_expected.to include begin_error }
121
+ it { is_expected.to include end_error }
124
122
  end
125
123
  end
126
124
 
@@ -133,7 +131,7 @@ describe MetasploitDataModels::Search::Operation::Port::Range do
133
131
  '1'
134
132
  }
135
133
 
136
- it { should include(error) }
134
+ it { is_expected.to include(error) }
137
135
  end
138
136
  end
139
137
  end
@@ -1,6 +1,4 @@
1
- require 'spec_helper'
2
-
3
- describe MetasploitDataModels::Search::Operation::Range do
1
+ RSpec.describe MetasploitDataModels::Search::Operation::Range, type: :model do
4
2
  subject(:range_operation) {
5
3
  described_class.new(attributes)
6
4
  }
@@ -11,7 +9,7 @@ describe MetasploitDataModels::Search::Operation::Range do
11
9
  described_class::SEPARATOR
12
10
  }
13
11
 
14
- it { should == '-' }
12
+ it { is_expected.to eq('-') }
15
13
  end
16
14
  end
17
15
 
@@ -57,7 +55,7 @@ describe MetasploitDataModels::Search::Operation::Range do
57
55
  '1-2'
58
56
  }
59
57
 
60
- it { should_not include(error) }
58
+ it { is_expected.not_to include(error) }
61
59
  end
62
60
 
63
61
  context 'with begin same as end' do
@@ -72,7 +70,7 @@ describe MetasploitDataModels::Search::Operation::Range do
72
70
  '1-1'
73
71
  }
74
72
 
75
- it { should_not include(error) }
73
+ it { is_expected.not_to include(error) }
76
74
  end
77
75
 
78
76
  context 'with begin after end' do
@@ -87,7 +85,7 @@ describe MetasploitDataModels::Search::Operation::Range do
87
85
  '2-1'
88
86
  }
89
87
 
90
- it { should include error }
88
+ it { is_expected.to include error }
91
89
  end
92
90
  end
93
91
 
@@ -103,7 +101,7 @@ describe MetasploitDataModels::Search::Operation::Range do
103
101
  '1..2'
104
102
  }
105
103
 
106
- it { should_not include(error) }
104
+ it { is_expected.not_to include(error) }
107
105
  end
108
106
  end
109
107
 
@@ -113,7 +111,7 @@ describe MetasploitDataModels::Search::Operation::Range do
113
111
  '1-2'
114
112
  }
115
113
 
116
- it { should be_empty }
114
+ it { is_expected.to be_empty }
117
115
  end
118
116
 
119
117
  context 'without Range' do
@@ -125,7 +123,7 @@ describe MetasploitDataModels::Search::Operation::Range do
125
123
  '1..2'
126
124
  }
127
125
 
128
- it { should include error }
126
+ it { is_expected.to include error }
129
127
  end
130
128
  end
131
129
  end