Fix strip_whitespace speccing

bug/bundler_fix
Meatballs 2014-11-27 21:30:08 +00:00
parent 48a5123607
commit 94fa6a309c
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 5 additions and 1 deletions

View File

@ -78,6 +78,7 @@ describe Msf::Exploit::Powershell do
context 'when strip_whitespace is true' do context 'when strip_whitespace is true' do
before do before do
subject.datastore['Powershell::strip_comments'] = false
subject.datastore['Powershell::strip_whitespace'] = true subject.datastore['Powershell::strip_whitespace'] = true
subject.options.validate(subject.datastore) subject.options.validate(subject.datastore)
end end
@ -90,13 +91,16 @@ describe Msf::Exploit::Powershell do
context 'when strip_whitespace is false' do context 'when strip_whitespace is false' do
before do before do
subject.datastore['Powershell::strip_comments'] = false
subject.datastore['Powershell::strip_whitespace'] = false subject.datastore['Powershell::strip_whitespace'] = false
subject.options.validate(subject.datastore) subject.options.validate(subject.datastore)
end end
it 'shouldnt strip whitespace' do it 'shouldnt strip whitespace' do
script = File.read(example_script) script = File.read(example_script)
File.open('/tmp/1','w') { |f| f.write script }
compressed = subject.compress_script(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
end end