add string_assignments_spec

GSoC/Meterpreter_Web_Console
Wei Chen 2018-06-28 21:15:30 -05:00
parent 066843bb6c
commit 0d55412e80
1 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,22 @@
require 'metasploit/framework/obfuscation/crandomizer/code_factory'
RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::StringAssignments do
subject(:stringassignments) do
described_class.new
end
describe '#stub' do
it 'is a string' do
expect(subject.send(:stub).class).to be(String)
end
it 'assigns a string' do
expect(subject.stub).to match(/const char\* .+ = ".+"/)
end
it 'has a stub() function' do
expect(subject.send(:stub)).to match(/void stub()/)
end
end
end