From e733e3b62cb74999fd3efd6ae5df5b564e6ba640 Mon Sep 17 00:00:00 2001 From: Wei Chen Date: Thu, 28 Jun 2018 20:59:56 -0500 Subject: [PATCH] Add rpsec int_assignments_spec --- .../code_factory/int_assignments_spec.rb | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/lib/metasploit/framework/obfuscation/crandomizer/code_factory/int_assignments_spec.rb diff --git a/spec/lib/metasploit/framework/obfuscation/crandomizer/code_factory/int_assignments_spec.rb b/spec/lib/metasploit/framework/obfuscation/crandomizer/code_factory/int_assignments_spec.rb new file mode 100644 index 0000000000..9cf70993fe --- /dev/null +++ b/spec/lib/metasploit/framework/obfuscation/crandomizer/code_factory/int_assignments_spec.rb @@ -0,0 +1,22 @@ +require 'metasploit/framework/obfuscation/crandomizer/code_factory' + +RSpec.describe Metasploit::Framework::Obfuscation::CRandomizer::CodeFactory::IntAssignments do + + subject(:int_assignments) do + described_class.new + end + + describe '#if_stub' do + it 'is a string' do + expect(subject.send(:stub).class).to be(String) + end + + it 'has an int assignment' do + expect(subject.send(:stub)).to match(/int .+ = \d+/) + end + + it 'has a stub() function' do + expect(subject.send(:stub)).to match(/void stub()/) + end + end +end \ No newline at end of file