Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.
Path: blob/master/spec/tools/dev/msftidy_runner_spec.rb
Views: 11779
require 'spec_helper'12require Metasploit::Framework.root.join('tools/dev/msftidy.rb').to_path34RSpec.describe MsftidyRunner do5context 'with a tidy auxiliary module' do6let(:auxiliary_tidy) { File.expand_path('modules/auxiliary/auxiliary_tidy.rb', FILE_FIXTURES_PATH) }7let(:msftidy) { described_class.new(auxiliary_tidy) }89before(:each) do10get_stdout do11msftidy.run_checks12@msftidy_status = msftidy.status13end14end1516it 'returns zero (no warnings or errors)' do17expect(@msftidy_status).to be_zero18end19end2021context 'with an untidy auxiliary module' do22let(:auxiliary_untidy) { File.expand_path('modules/auxiliary/auxiliary_untidy.rb', FILE_FIXTURES_PATH) }23let(:msftidy) { described_class.new(auxiliary_untidy) }2425before(:each) do26@msftidy_stdout = get_stdout { msftidy.run_checks }27end2829it 'ERRORs when invalid superclass' do30expect(@msftidy_stdout).to match(/ERROR.+Invalid super class for auxiliary module/)31end3233it 'WARNINGs when specifying Rank' do34expect(@msftidy_stdout).to match(/WARNING.+Rank/)35end36end3738context 'with a tidy payload module' do39let(:payload_tidy) { File.expand_path('modules/payloads/payload_tidy.rb', FILE_FIXTURES_PATH) }40let(:msftidy) { described_class.new(payload_tidy) }4142before(:each) do43get_stdout do44msftidy.run_checks45@msftidy_status = msftidy.status46end47end4849it 'returns zero (no warnings or errors)' do50expect(@msftidy_status).to be_zero51end52end53end545556