Skip to content

Commit 69e2c09

Browse files
committed
Add ruby_version_is guard to CVE-2019-8322 spec for changing displayed message
1 parent 33a3e16 commit 69e2c09

1 file changed

Lines changed: 18 additions & 15 deletions

File tree

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,24 @@
11
require_relative '../spec_helper'
22

3-
require 'yaml'
4-
require 'rubygems'
5-
require 'rubygems/safe_yaml'
6-
require 'rubygems/commands/owner_command'
3+
ruby_version_is ""..."4.0" do
74

8-
describe "CVE-2019-8322 is resisted by" do
9-
it "sanitising owner names" do
10-
command = Gem::Commands::OwnerCommand.new
11-
def command.rubygems_api_request(*args)
12-
Struct.new(:body).new("---\n- email: \"\e]2;nyan\a\"\n handle: handle\n id: id\n")
13-
end
14-
def command.with_response(response)
15-
yield response
5+
require 'yaml'
6+
require 'rubygems'
7+
require 'rubygems/safe_yaml'
8+
require 'rubygems/commands/owner_command'
9+
10+
describe "CVE-2019-8322 is resisted by" do
11+
it "sanitising owner names" do
12+
command = Gem::Commands::OwnerCommand.new
13+
def command.rubygems_api_request(*args)
14+
Struct.new(:body).new("---\n- email: \"\e]2;nyan\a\"\n handle: handle\n id: id\n")
15+
end
16+
def command.with_response(response)
17+
yield response
18+
end
19+
command.should_receive(:say).with("Owners for gem: name")
20+
command.should_receive(:say).with("- .]2;nyan.")
21+
command.show_owners "name"
1622
end
17-
command.should_receive(:say).with("Owners for gem: name")
18-
command.should_receive(:say).with("- .]2;nyan.")
19-
command.show_owners "name"
2023
end
2124
end

0 commit comments

Comments
 (0)