Add rspec for gettickcount

GSoC/Meterpreter_Web_Console
Wei Chen 2018-06-28 16:51:57 -05:00
parent 8be771f72f
commit 93fca248d6
1 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,37 @@
require 'metasploit/framework/obfuscation/crandomizer/code_factory'
RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::GetTickCount do
subject(:get_tick_count) do
described_class.new
end
describe '#single_gettickcount' do
it 'is a string' do
expect(subject.send(:single_gettickcount).class).to be(String)
end
it 'has a GetTickCount() declaration' do
expect(subject.send(:single_gettickcount)).to match(/int GetTickCount()/)
end
it 'has a stub() function' do
expect(subject.send(:single_gettickcount)).to match(/void stub()/)
end
end
describe '#diff_gettickcount' do
it 'is a string' do
expect(subject.send(:diff_gettickcount).class).to be(String)
end
it 'has a GetTickCount() declaration' do
expect(subject.send(:diff_gettickcount)).to match(/int GetTickCount()/)
end
it 'has a stub() function' do
expect(subject.send(:diff_gettickcount)).to match(/void stub()/)
end
end
end