Add printf_spec

This commit is contained in:
Wei Chen 2018-06-28 21:12:34 -05:00
parent 39bbfb0c58
commit 066843bb6c
1 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,26 @@
require 'metasploit/framework/obfuscation/crandomizer/code_factory'
RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::Printf do
subject(:printf) do
described_class.new
end
describe '#stub' do
it 'is a string' do
expect(subject.send(:stub).class).to be(String)
end
it 'has a printf' do
expect(subject.send(:stub)).to match(/printf\(.+\)/)
end
it 'has a stub() function' do
expect(subject.send(:stub)).to match(/void stub()/)
end
it 'depends on printf' do
expect(subject.dep).to eq(['printf'])
end
end
end