diff --git a/spec/ruby/security/cve_2019_8325_spec.rb b/spec/ruby/security/cve_2019_8325_spec.rb index 04692e01fe..7c5e216568 100644 --- a/spec/ruby/security/cve_2019_8325_spec.rb +++ b/spec/ruby/security/cve_2019_8325_spec.rb @@ -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