Red Msf::ModuleSet#rank_modules with create -> nil

MSP-12557

Msf::ModuleSet#rank_modules does not handle Msf::ModuleSet#create
returning `nil`.
bug/bundler_fix
Luke Imhoff 2015-04-15 11:59:34 -05:00
parent ef6bf54e2f
commit 7a14618481
No known key found for this signature in database
GPG Key ID: 5B1FB01FB33356F8
1 changed files with 59 additions and 0 deletions

View File

@ -0,0 +1,59 @@
require 'spec_helper'
RSpec.describe Msf::ModuleSet do
subject(:module_set) {
described_class.new(module_type)
}
let(:module_type) {
FactoryGirl.generate :mdm_module_detail_mtype
}
context '#rank_modules' do
subject(:rank_modules) {
module_set.send(:rank_modules)
}
context 'with Msf::SymbolicModule' do
before(:each) do
module_set['a'] = Msf::SymbolicModule
module_set['b'] = Msf::SymbolicModule
module_set['c'] = Msf::SymbolicModule
end
context 'create' do
context 'returns nil' do
before(:each) do
allow(module_set).to receive(:create).and_return(nil)
end
specify {
expect {
rank_modules
}.not_to raise_error
}
end
context 'does not return nil' do
context 'with Rank' do
it 'is ranked using Rank'
end
context 'without Rank' do
it 'is ranked as Normal'
end
end
end
end
context 'without Msf::SymbolicModule' do
context 'with Rank' do
it 'is ranked using Rank'
end
context 'without Rank' do
it 'is ranked as Normal'
end
end
end
end