Silent backtrace from cve_2019_8325_spec.rb

Since the change at f310ac1cb2 to show
the backtraces by default, this test started to show the backtraces.
As the backtraces are not the subject of this test, silence them by
using Gem::SilentUI.
This commit is contained in:
Nobuyoshi Nakada 2022-08-07 17:57:52 +09:00 коммит произвёл GitHub
Родитель 0bb5525eb2
Коммит 03f86565a6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 9 добавлений и 0 удалений

Просмотреть файл

@ -5,8 +5,16 @@ require 'rubygems/command_manager'
describe "CVE-2019-8325 is resisted by" do
describe "sanitising error message components" do
silent_ui = Module.new do
attr_accessor :ui
def self.extended(obj)
obj.ui = Gem::SilentUI.new
end
end
it "for the 'while executing' message" do
manager = Gem::CommandManager.new
manager.extend(silent_ui)
def manager.process_args(args, build_args)
raise StandardError, "\e]2;nyan\a"
end
@ -26,6 +34,7 @@ describe "CVE-2019-8325 is resisted by" do
it "for the 'loading command' message" do
manager = Gem::CommandManager.new
manager.extend(silent_ui)
def manager.require(x)
raise 'foo'
end