Skip to content

Commit 60ecf4e

Browse files
jvazquez-r7kernelsmith
authored andcommitted
Use be_truthy instead of be_true
1 parent 6e3739a commit 60ecf4e

File tree

30 files changed

+147
-147
lines changed

30 files changed

+147
-147
lines changed

spec/lib/active_record/connection_adapters/abstract_adapter/connection_pool_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def database_configurations_pathname
4444
end
4545

4646
context 'in thread with connection' do
47-
it { should be_true }
47+
it { should be_truthy }
4848
end
4949

5050
context 'in thread without connection' do
@@ -97,7 +97,7 @@ def reserved_connection_count
9797
end
9898

9999
it 'should return true from #active_connection?' do
100-
expect(connection_pool.active_connection?).to be_true
100+
expect(connection_pool.active_connection?).to be_truthy
101101
end
102102

103103
context 'with error' do

spec/lib/fastlib_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
described_class.dump(@destination_path, flag_string, base_path, *unarchived_paths)
7575

76-
File.exist?(@destination_path).should be_true
76+
File.exist?(@destination_path).should be_truthy
7777
end
7878

7979
context 'cache' do
@@ -114,7 +114,7 @@
114114

115115
# make sure that the unarchived module exists and hasn't be deleted or renamed before expecting it to be
116116
# in the archive.
117-
File.exist?(unarchived_path).should be_true
117+
File.exist?(unarchived_path).should be_truthy
118118
cache[archived_path].should_not be_nil
119119
end
120120
end
@@ -131,7 +131,7 @@
131131

132132
described_class.dump(@destination_path, flag_string, base_path, *unarchived_paths)
133133

134-
File.exist?(@destination_path).should be_true
134+
File.exist?(@destination_path).should be_truthy
135135
end
136136

137137
it 'should be smaller than the uncompressed archive' do
@@ -144,8 +144,8 @@
144144
described_class.dump(uncompressed_path, '', base_path, *unarchived_paths)
145145
described_class.dump(compressed_path, flag_string, base_path, *unarchived_paths)
146146

147-
File.exist?(uncompressed_path).should be_true
148-
File.exist?(compressed_path).should be_true
147+
File.exist?(uncompressed_path).should be_truthy
148+
File.exist?(compressed_path).should be_truthy
149149

150150
File.size(compressed_path).should < File.size(uncompressed_path)
151151
end
@@ -161,7 +161,7 @@
161161

162162
described_class.dump(@destination_path, flag_string, base_path, *unarchived_paths)
163163

164-
File.exist?(@destination_path).should be_true
164+
File.exist?(@destination_path).should be_truthy
165165
end
166166
end
167167

@@ -175,7 +175,7 @@
175175

176176
described_class.dump(@destination_path, flag_string, base_path, *unarchived_paths)
177177

178-
File.exist?(@destination_path).should be_true
178+
File.exist?(@destination_path).should be_truthy
179179
end
180180
end
181181
end
@@ -194,7 +194,7 @@
194194
# ensure modules expected to be listed actually exist
195195
it 'should use existent unarchived modules' do
196196
unarchived_paths.each do |unarchived_path|
197-
File.exist?(unarchived_path).should be_true
197+
File.exist?(unarchived_path).should be_truthy
198198
end
199199
end
200200

spec/lib/metasploit/framework/credential_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
describe "#paired" do
2424
it "defaults to true" do
25-
expect(cred_detail.paired).to be_true
25+
expect(cred_detail.paired).to be_truthy
2626
end
2727
end
2828

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,14 @@
2929
context '#success?' do
3030
context 'when the status code is success' do
3131
it 'returns true' do
32-
expect(login_result.success?).to be_true
32+
expect(login_result.success?).to be_truthy
3333
end
3434
end
3535

3636
context 'when the status code is anything else' do
3737
let(:status) { :connection_error }
3838
it 'returns false' do
39-
expect(login_result.success?).to be_false
39+
expect(login_result.success?).to be_truthy
4040
end
4141
end
4242
end

spec/lib/msf/core/exploit/cmdstager_spec.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def create_exploit(info ={})
332332
end
333333

334334
it "is compatible" do
335-
expect(subject.compatible_flavor?(flavor)).to be_true
335+
expect(subject.compatible_flavor?(flavor)).to be_truthy
336336
end
337337
end
338338

@@ -348,7 +348,7 @@ def create_exploit(info ={})
348348
end
349349

350350
it "is compatible" do
351-
expect(subject.compatible_flavor?(flavor)).to be_true
351+
expect(subject.compatible_flavor?(flavor)).to be_truthy
352352
end
353353
end
354354

@@ -375,7 +375,7 @@ def create_exploit(info ={})
375375
end
376376

377377
it "is compatible" do
378-
expect(subject.compatible_flavor?(flavor)).to be_true
378+
expect(subject.compatible_flavor?(flavor)).to be_truthy
379379
end
380380
end
381381

@@ -402,7 +402,7 @@ def create_exploit(info ={})
402402
end
403403

404404
it "is compatible" do
405-
expect(subject.compatible_flavor?(flavor)).to be_true
405+
expect(subject.compatible_flavor?(flavor)).to be_truthy
406406
end
407407
end
408408

spec/lib/msf/core/exploit/powershell_spec.rb

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,13 @@ def decompress(code)
4343
script = File.read(example_script)
4444
compressed = subject.compress_script(script)
4545
compressed.length.should be < script.length
46-
compressed.include?('IO.Compression').should be_true
46+
compressed.include?('IO.Compression').should be_truthy
4747
end
4848

4949
it 'should create a compressed script with eof' do
5050
script = File.read(example_script)
5151
compressed = subject.compress_script(script, 'end_of_file')
52-
compressed.include?('end_of_file').should be_true
52+
compressed.include?('end_of_file').should be_truthy
5353
end
5454
end
5555

@@ -120,7 +120,7 @@ def decompress(code)
120120
it 'shouldnt substitute variables' do
121121
script = File.read(example_script)
122122
compressed = subject.compress_script(script)
123-
decompress(compressed).include?('$hashes').should be_true
123+
decompress(compressed).include?('$hashes').should be_truthy
124124
end
125125
end
126126

@@ -144,7 +144,7 @@ def decompress(code)
144144
it 'shouldnt substitute variables' do
145145
script = File.read(example_script)
146146
compressed = subject.compress_script(script)
147-
decompress(compressed).include?('DumpHashes').should be_true
147+
decompress(compressed).include?('DumpHashes').should be_truthy
148148
end
149149
end
150150
end
@@ -159,28 +159,28 @@ def decompress(code)
159159
context 'when x86 payload' do
160160
it 'should generate code' do
161161
code = subject.run_hidden_psh(payload, arch, encoded)
162-
code.include?('syswow64').should be_true
162+
code.include?('syswow64').should be_truthy
163163
end
164164
end
165165

166166
context 'when x64 payload' do
167167
it 'should generate code' do
168168
code = subject.run_hidden_psh(payload, 'x86_64', encoded)
169-
code.include?('sysnative').should be_true
169+
code.include?('sysnative').should be_truthy
170170
end
171171
end
172172

173173
context 'when encoded' do
174174
it 'should generate a code including an encoded command' do
175175
code = subject.run_hidden_psh(payload, arch, true)
176-
code.include?('-nop -w hidden -e ').should be_true
176+
code.include?('-nop -w hidden -e ').should be_truthy
177177
end
178178
end
179179

180180
context 'when command' do
181181
it 'should generate code including a -c command' do
182182
code = subject.run_hidden_psh(payload, arch, encoded)
183-
code.include?('-nop -w hidden -c ').should be_true
183+
code.include?('-nop -w hidden -c ').should be_truthy
184184
end
185185
end
186186

@@ -191,7 +191,7 @@ def decompress(code)
191191
end
192192
it 'should generate a code including unshorted args' do
193193
code = subject.run_hidden_psh(payload, arch, encoded)
194-
code.include?('-NoProfile -WindowStyle hidden -NoExit -Command ').should be_true
194+
code.include?('-NoProfile -WindowStyle hidden -NoExit -Command ').should be_truthy
195195
end
196196
end
197197
end
@@ -206,7 +206,7 @@ def decompress(code)
206206
except = true
207207
end
208208

209-
except.should be_true
209+
except.should be_truthy
210210
end
211211
end
212212

@@ -217,7 +217,7 @@ def decompress(code)
217217
end
218218
it 'should add a persistance loop' do
219219
code = subject.cmd_psh_payload(payload, arch)
220-
decompress(code).include?('while(1){Start-Sleep -s ').should be_true
220+
decompress(code).include?('while(1){Start-Sleep -s ').should be_truthy
221221
end
222222
end
223223

@@ -239,7 +239,7 @@ def decompress(code)
239239
end
240240
it 'should prepend sleep' do
241241
code = subject.cmd_psh_payload(payload, arch)
242-
decompress(code).include?('Start-Sleep -s ').should be_true
242+
decompress(code).include?('Start-Sleep -s ').should be_truthy
243243
end
244244
end
245245

@@ -272,15 +272,15 @@ def decompress(code)
272272
end
273273
it 'should generate a command line' do
274274
code = subject.cmd_psh_payload(payload, arch)
275-
decompress(code).include?('-namespace Win32Functions').should be_true
275+
decompress(code).include?('-namespace Win32Functions').should be_truthy
276276
end
277277
it 'shouldnt shorten args' do
278278
code = subject.cmd_psh_payload(payload, arch)
279-
code.include?('-NoProfile -WindowStyle hidden -Command').should be_true
279+
code.include?('-NoProfile -WindowStyle hidden -Command').should be_truthy
280280
end
281281
it 'should include -NoExit' do
282282
code = subject.cmd_psh_payload(payload, arch)
283-
code.include?('-NoProfile -WindowStyle hidden -NoExit -Command').should be_true
283+
code.include?('-NoProfile -WindowStyle hidden -NoExit -Command').should be_truthy
284284
end
285285
end
286286

@@ -291,7 +291,7 @@ def decompress(code)
291291
end
292292
it 'should generate a command line' do
293293
code = subject.cmd_psh_payload(payload, arch)
294-
decompress(code).include?('System.Runtime.InteropServices;').should be_true
294+
decompress(code).include?('System.Runtime.InteropServices;').should be_truthy
295295
end
296296
end
297297

@@ -302,7 +302,7 @@ def decompress(code)
302302
end
303303
it 'should generate a command line' do
304304
code = subject.cmd_psh_payload(payload, arch)
305-
decompress(code).include?('GlobalAssemblyCache').should be_true
305+
decompress(code).include?('GlobalAssemblyCache').should be_truthy
306306
end
307307
end
308308

@@ -318,7 +318,7 @@ def decompress(code)
318318
rescue RuntimeError
319319
except = true
320320
end
321-
except.should be_true
321+
except.should be_truthy
322322
end
323323
end
324324

@@ -333,7 +333,7 @@ def decompress(code)
333333
rescue RuntimeError
334334
except = true
335335
end
336-
except.should be_true
336+
except.should be_truthy
337337
end
338338
after do
339339
subject.datastore['Powershell::method'] = 'reflection'
@@ -344,7 +344,7 @@ def decompress(code)
344344
context 'when encode_inner_payload' do
345345
it 'should contain an inner payload with -e' do
346346
code = subject.cmd_psh_payload(payload, arch, {:encode_inner_payload => true})
347-
code.include?(' -e ').should be_true
347+
code.include?(' -e ').should be_truthy
348348
end
349349

350350
context 'when no_equals is true' do
@@ -355,7 +355,7 @@ def decompress(code)
355355
rescue RuntimeError
356356
except = true
357357
end
358-
except.should be_true
358+
except.should be_truthy
359359
end
360360
end
361361
end
@@ -364,14 +364,14 @@ def decompress(code)
364364
context 'when no_equals is false' do
365365
it 'should contain a final payload with -e' do
366366
code = subject.cmd_psh_payload(payload, arch, {:encode_final_payload => true, :no_equals => false})
367-
code.include?(' -e ').should be_true
367+
code.include?(' -e ').should be_truthy
368368
code.include?(' -c ').should be_false
369369
end
370370
end
371371
context 'when no_equals is true' do
372372
it 'should contain a final payload with -e' do
373373
code = subject.cmd_psh_payload(payload, arch, {:encode_final_payload => true, :no_equals => true})
374-
code.include?(' -e ').should be_true
374+
code.include?(' -e ').should be_truthy
375375
code.include?(' -c ').should be_false
376376
code.include?('=').should be_false
377377
end
@@ -384,7 +384,7 @@ def decompress(code)
384384
rescue RuntimeError
385385
except = true
386386
end
387-
except.should be_true
387+
except.should be_truthy
388388
end
389389
end
390390
end
@@ -399,7 +399,7 @@ def decompress(code)
399399
context 'when use single quotes' do
400400
it 'should wrap in single quotes' do
401401
code = subject.cmd_psh_payload(payload, arch, {:use_single_quotes => true})
402-
code.include?(' -c \'').should be_true
402+
code.include?(' -c \'').should be_truthy
403403
end
404404
end
405405
end
@@ -408,27 +408,27 @@ def decompress(code)
408408
it 'should contain no full stop when :no_full_stop' do
409409
opts = {:no_full_stop => true}
410410
command = subject.generate_psh_command_line(opts)
411-
command.include?("powershell ").should be_true
411+
command.include?("powershell ").should be_truthy
412412
end
413413

414414
it 'should contain full stop unless :no_full_stop' do
415415
opts = {}
416416
command = subject.generate_psh_command_line(opts)
417-
command.include?("powershell.exe ").should be_true
417+
command.include?("powershell.exe ").should be_truthy
418418

419419
opts = {:no_full_stop => false}
420420
command = subject.generate_psh_command_line(opts)
421-
command.include?("powershell.exe ").should be_true
421+
command.include?("powershell.exe ").should be_truthy
422422
end
423423

424424
it 'should ensure the path should always ends with \\' do
425425
opts = {:path => "test"}
426426
command = subject.generate_psh_command_line(opts)
427-
command.include?("test\\powershell.exe ").should be_true
427+
command.include?("test\\powershell.exe ").should be_truthy
428428

429429
opts = {:path => "test\\"}
430430
command = subject.generate_psh_command_line(opts)
431-
command.include?("test\\powershell.exe ").should be_true
431+
command.include?("test\\powershell.exe ").should be_truthy
432432
end
433433
end
434434

0 commit comments

Comments
 (0)