Exclude Ruby external modules from rspec

The sum of the testing code and loading code assumptions was that all
files with the same extension in the same folder were all loadable with
the same loader. This is no longer the case, and until we are ready to
test the load-ability of external modules we can safely ignore them.
GSoC/Meterpreter_Web_Console
Adam Cammack 2018-03-23 16:44:58 -05:00
parent 5ece14b064
commit c28fe65d98
No known key found for this signature in database
GPG Key ID: C9378BA088092D66
1 changed files with 12 additions and 10 deletions

View File

@ -18,17 +18,19 @@ RSpec.shared_examples_for 'all modules with module type can be instantiated' do
module_extension_regexp = /#{Regexp.escape(module_extension)}$/
Dir.glob(type_pathname.join('**', "*#{module_extension}")) do |module_path|
module_pathname = Pathname.new(module_path)
module_reference_pathname = module_pathname.relative_path_from(type_pathname)
module_reference_name = module_reference_pathname.to_path.gsub(module_extension_regexp, '')
unless File.executable? module_path
module_pathname = Pathname.new(module_path)
module_reference_pathname = module_pathname.relative_path_from(type_pathname)
module_reference_name = module_reference_pathname.to_path.gsub(module_extension_regexp, '')
context module_reference_name do
it 'can be instantiated' do
load_and_create_module(
module_type: module_type,
modules_path: modules_path,
reference_name: module_reference_name
)
context module_reference_name do
it 'can be instantiated' do
load_and_create_module(
module_type: module_type,
modules_path: modules_path,
reference_name: module_reference_name
)
end
end
end
end