Skip to content

Commit

Permalink
Land #18380, Fix broken test suite when running in small console window
Browse files Browse the repository at this point in the history
  • Loading branch information
sjanusz-r7 authored Sep 20, 2023
2 parents 2722067 + d71883f commit 1ef030d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,15 @@
Msf::FeatureManager.instance.set(Msf::FeatureManager::DATASTORE_FALLBACKS, true)
end
end

# rex-text table performs word wrapping on msfconsole tables:
# https://github.com/rapid7/rex-text/blob/11e59416f7d8cce18b8b8b9893b3277e6ad0bea1/lib/rex/text/wrapped_table.rb#L74
# This can cause some integration tests to fail if the tests are run from smaller consoles
# This mock will ensure that the tests run without word-wrapping.
config.before(:each) do
mock_io_console = double(:console, winsize: { rows: 30, columns: ::BigDecimal::INFINITY }.values)
allow(::IO).to receive(:console).and_return(mock_io_console)
end
end

if load_metasploit
Expand Down

0 comments on commit 1ef030d

Please sign in to comment.