mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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:
parent
0bb5525eb2
commit
03f86565a6
Notes:
git
2022-08-07 17:58:18 +09:00
Merged: https://github.com/ruby/ruby/pull/6220 Merged-By: nobu <nobu@ruby-lang.org>
1 changed files with 9 additions and 0 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue