/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
spec/tools/dev/msftidy_runner_spec.rb
54 строки
2 KB
Alan Foster
Require rubocop for new modules
24 фев 2021, 02:05
Не верифицирован
24 фев 2021, 02:05
2605270
Код
Авторство
О чём код?
require 'spec_helper' require Metasploit::Framework.root.join('tools/dev/msftidy.rb').to_path RSpec.describe MsftidyRunner do context 'with a tidy auxiliary module' do let(:auxiliary_tidy) { File.expand_path('modules/auxiliary/auxiliary_tidy.rb', FILE_FIXTURES_PATH) } let(:msftidy) { described_class.new(auxiliary_tidy) } before(:each) do get_stdout do msftidy.run_checks @msftidy_status = msftidy.status end end it 'returns zero (no warnings or errors)' do expect(@msftidy_status).to be_zero end end context 'with an untidy auxiliary module' do let(:auxiliary_untidy) { File.expand_path('modules/auxiliary/auxiliary_untidy.rb', FILE_FIXTURES_PATH) } let(:msftidy) { described_class.new(auxiliary_untidy) } before(:each) do @msftidy_stdout = get_stdout { msftidy.run_checks } end it 'ERRORs when invalid superclass' do expect(@msftidy_stdout).to match(/ERROR.+Invalid super class for auxiliary module/) end it 'WARNINGs when specifying Rank' do expect(@msftidy_stdout).to match(/WARNING.+Rank/) end end context 'with a tidy payload module' do let(:payload_tidy) { File.expand_path('modules/payloads/payload_tidy.rb', FILE_FIXTURES_PATH) } let(:msftidy) { described_class.new(payload_tidy) } before(:each) do get_stdout do msftidy.run_checks @msftidy_status = msftidy.status end end it 'returns zero (no warnings or errors)' do expect(@msftidy_status).to be_zero end end end