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
parent
5ece14b064
commit
c28fe65d98
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue