Skip to content

Commit d711666

Browse files
committed
1 parent 40e5986 commit d711666

File tree

222 files changed

+930
-710
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

222 files changed

+930
-710
lines changed

spec/ruby/command_line/dash_v_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
describe "when used alone" do
88
it "prints version and ends" do
9-
ruby_exe(nil, args: '-v').should include(RUBY_DESCRIPTION)
9+
ruby_exe(nil, args: '-v').sub("+PRISM ", "").should include(RUBY_DESCRIPTION)
1010
end unless (defined?(RubyVM::YJIT) && RubyVM::YJIT.enabled?) ||
1111
(defined?(RubyVM::RJIT) && RubyVM::RJIT.enabled?) ||
1212
(ENV['RUBY_MN_THREADS'] == '1')

spec/ruby/core/argf/readpartial_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
it "clears output buffer even if EOFError is raised because @argf is at end" do
3131
begin
32-
output = "to be cleared"
32+
output = +"to be cleared"
3333

3434
argf [@file1_name] do
3535
@argf.read

spec/ruby/core/argf/shared/getc.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
it "reads each char of files" do
1111
argf [@file1, @file2] do
12-
chars = ""
12+
chars = +""
1313
@chars.size.times { chars << @argf.send(@method) }
1414
chars.should == @chars
1515
end

spec/ruby/core/argf/shared/read.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515

1616
it "treats second argument as an output buffer" do
1717
argf [@file1_name] do
18-
buffer = ""
18+
buffer = +""
1919
@argf.send(@method, @file1.size, buffer)
2020
buffer.should == @file1
2121
end
2222
end
2323

2424
it "clears output buffer before appending to it" do
2525
argf [@file1_name] do
26-
buffer = "to be cleared"
26+
buffer = +"to be cleared"
2727
@argf.send(@method, @file1.size, buffer)
2828
buffer.should == @file1
2929
end

spec/ruby/core/array/fill_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
it "does not replicate the filler" do
2323
ary = [1, 2, 3, 4]
24-
str = "x"
24+
str = +"x"
2525
ary.fill(str).should == [str, str, str, str]
2626
str << "y"
2727
ary.should == [str, str, str, str]

spec/ruby/core/array/fixtures/encoded_strings.rb

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,36 @@
22
module ArraySpecs
33
def self.array_with_usascii_and_7bit_utf8_strings
44
[
5-
'foo'.force_encoding('US-ASCII'),
5+
'foo'.dup.force_encoding('US-ASCII'),
66
'bar'
77
]
88
end
99

1010
def self.array_with_usascii_and_utf8_strings
1111
[
12-
'foo'.force_encoding('US-ASCII'),
12+
'foo'.dup.force_encoding('US-ASCII'),
1313
'báz'
1414
]
1515
end
1616

1717
def self.array_with_7bit_utf8_and_usascii_strings
1818
[
1919
'bar',
20-
'foo'.force_encoding('US-ASCII')
20+
'foo'.dup.force_encoding('US-ASCII')
2121
]
2222
end
2323

2424
def self.array_with_utf8_and_usascii_strings
2525
[
2626
'báz',
2727
'bar',
28-
'foo'.force_encoding('US-ASCII')
28+
'foo'.dup.force_encoding('US-ASCII')
2929
]
3030
end
3131

3232
def self.array_with_usascii_and_utf8_strings
3333
[
34-
'foo'.force_encoding('US-ASCII'),
34+
'foo'.dup.force_encoding('US-ASCII'),
3535
'bar',
3636
'báz'
3737
]
@@ -41,7 +41,7 @@ def self.array_with_utf8_and_7bit_binary_strings
4141
[
4242
'bar',
4343
'báz',
44-
'foo'.force_encoding('BINARY')
44+
'foo'.dup.force_encoding('BINARY')
4545
]
4646
end
4747

@@ -55,14 +55,14 @@ def self.array_with_utf8_and_binary_strings
5555

5656
def self.array_with_usascii_and_7bit_binary_strings
5757
[
58-
'bar'.force_encoding('US-ASCII'),
59-
'foo'.force_encoding('BINARY')
58+
'bar'.dup.force_encoding('US-ASCII'),
59+
'foo'.dup.force_encoding('BINARY')
6060
]
6161
end
6262

6363
def self.array_with_usascii_and_binary_strings
6464
[
65-
'bar'.force_encoding('US-ASCII'),
65+
'bar'.dup.force_encoding('US-ASCII'),
6666
[255].pack('C').force_encoding('BINARY')
6767
]
6868
end

spec/ruby/core/array/pack/buffer_spec.rb

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@
1313
it "adds result at the end of buffer content" do
1414
n = [ 65, 66, 67 ] # result without buffer is "ABC"
1515

16-
buffer = ""
16+
buffer = +""
1717
n.pack("ccc", buffer: buffer).should == "ABC"
1818

19-
buffer = "123"
19+
buffer = +"123"
2020
n.pack("ccc", buffer: buffer).should == "123ABC"
2121

22-
buffer = "12345"
22+
buffer = +"12345"
2323
n.pack("ccc", buffer: buffer).should == "12345ABC"
2424
end
2525

@@ -31,19 +31,19 @@
3131
context "offset (@) is specified" do
3232
it 'keeps buffer content if it is longer than offset' do
3333
n = [ 65, 66, 67 ]
34-
buffer = "123456"
34+
buffer = +"123456"
3535
n.pack("@3ccc", buffer: buffer).should == "123ABC"
3636
end
3737

3838
it "fills the gap with \\0 if buffer content is shorter than offset" do
3939
n = [ 65, 66, 67 ]
40-
buffer = "123"
40+
buffer = +"123"
4141
n.pack("@6ccc", buffer: buffer).should == "123\0\0\0ABC"
4242
end
4343

4444
it 'does not keep buffer content if it is longer than offset + result' do
4545
n = [ 65, 66, 67 ]
46-
buffer = "1234567890"
46+
buffer = +"1234567890"
4747
n.pack("@3ccc", buffer: buffer).should == "123ABC"
4848
end
4949
end

spec/ruby/core/array/pack/shared/string.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
f = pack_format("*")
4141
[ [["\u{3042 3044 3046 3048}", 0x2000B].pack(f+"U"), Encoding::BINARY],
4242
[["abcde\xd1", "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::BINARY],
43-
[["a".force_encoding("ascii"), "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::BINARY],
43+
[["a".dup.force_encoding("ascii"), "\xFF\xFe\x81\x82"].pack(f+"u"), Encoding::BINARY],
4444
# under discussion [ruby-dev:37294]
4545
[["\u{3042 3044 3046 3048}", 1].pack(f+"N"), Encoding::BINARY]
4646
].should be_computed_by(:encoding)

spec/ruby/core/array/shared/inspect.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
end
2020

2121
it "does not call #to_s on a String returned from #inspect" do
22-
str = "abc"
22+
str = +"abc"
2323
str.should_not_receive(:to_s)
2424

2525
[str].send(@method).should == '["abc"]'
@@ -98,8 +98,8 @@
9898
end
9999

100100
it "does not raise if inspected result is not default external encoding" do
101-
utf_16be = mock("utf_16be")
102-
utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode!(Encoding::UTF_16BE))
101+
utf_16be = mock(+"utf_16be")
102+
utf_16be.should_receive(:inspect).and_return(%<"utf_16be \u3042">.encode(Encoding::UTF_16BE))
103103

104104
[utf_16be].send(@method).should == '["utf_16be \u3042"]'
105105
end

spec/ruby/core/binding/fixtures/irbrc

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)