Add methods spec

bug/bundler_fix
Meatballs 2014-05-05 19:08:18 +01:00
parent 0b886db406
commit e946046de5
No known key found for this signature in database
GPG Key ID: 5380EAF01F2F8B38
1 changed files with 44 additions and 0 deletions

View File

@ -0,0 +1,44 @@
# -*- coding:binary -*-
require 'spec_helper'
require 'rex/exploitation/powershell'
describe Rex::Exploitation::Powershell::PshMethods do
describe "::download" do
it 'should return some powershell' do
script = Rex::Exploitation::Powershell::PshMethods.download('a')
script.should be
script.include?('WebClient').should be_true
end
end
describe "::uninstall" do
it 'should return some powershell' do
script = Rex::Exploitation::Powershell::PshMethods.uninstall('a')
script.should be
script.include?('Win32_Product').should be_true
end
end
describe "::secure_string" do
it 'should return some powershell' do
script = Rex::Exploitation::Powershell::PshMethods.secure_string('a')
script.should be
script.include?('AsPlainText').should be_true
end
end
describe "::who_locked_file?" do
it 'should return some powershell' do
script = Rex::Exploitation::Powershell::PshMethods.who_locked_file?('a')
script.should be
script.include?('Get-Process').should be_true
end
end
describe "::get_last_login" do
it 'should return some powershell' do
script = Rex::Exploitation::Powershell::PshMethods.get_last_login('a')
script.should be
script.include?('Get-QADComputer').should be_true
end
end
end