mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
a28aa80c73
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@67361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
38 lines
970 B
Ruby
38 lines
970 B
Ruby
require_relative '../spec_helper'
|
|
|
|
require 'optparse'
|
|
|
|
require 'rubygems'
|
|
require 'rubygems/gemcutter_utilities'
|
|
|
|
ruby_version_is "2.5.5" do
|
|
describe "CVE-2019-8323 is resisted by" do
|
|
describe "sanitising the body" do
|
|
it "for success codes" do
|
|
cutter = Class.new {
|
|
include Gem::GemcutterUtilities
|
|
}.new
|
|
response = Net::HTTPSuccess.new(nil, nil, nil)
|
|
def response.body
|
|
"\e]2;nyan\a"
|
|
end
|
|
cutter.should_receive(:say).with(".]2;nyan.")
|
|
cutter.with_response response
|
|
end
|
|
|
|
it "for error codes" do
|
|
cutter = Class.new {
|
|
include Gem::GemcutterUtilities
|
|
}.new
|
|
def cutter.terminate_interaction(n)
|
|
end
|
|
response = Net::HTTPNotFound.new(nil, nil, nil)
|
|
def response.body
|
|
"\e]2;nyan\a"
|
|
end
|
|
cutter.should_receive(:say).with(".]2;nyan.")
|
|
cutter.with_response response
|
|
end
|
|
end
|
|
end
|
|
end
|