Fix strip_whitespace speccing
parent
48a5123607
commit
94fa6a309c
|
@ -78,6 +78,7 @@ describe Msf::Exploit::Powershell do
|
|||
|
||||
context 'when strip_whitespace is true' do
|
||||
before do
|
||||
subject.datastore['Powershell::strip_comments'] = false
|
||||
subject.datastore['Powershell::strip_whitespace'] = true
|
||||
subject.options.validate(subject.datastore)
|
||||
end
|
||||
|
@ -90,13 +91,16 @@ describe Msf::Exploit::Powershell do
|
|||
|
||||
context 'when strip_whitespace is false' do
|
||||
before do
|
||||
subject.datastore['Powershell::strip_comments'] = false
|
||||
subject.datastore['Powershell::strip_whitespace'] = false
|
||||
subject.options.validate(subject.datastore)
|
||||
end
|
||||
it 'shouldnt strip whitespace' do
|
||||
script = File.read(example_script)
|
||||
File.open('/tmp/1','w') { |f| f.write script }
|
||||
compressed = subject.compress_script(script)
|
||||
decompress(compressed).length.should be script.length
|
||||
File.open('/tmp/2','w') { |f| f.write decompress(compressed) }
|
||||
expect(decompress(compressed).length).to eq(script.length)
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue