Skip to content

Commit b5e65db

Browse files
committed
[GR-14806] Update specs.
PullRequest: truffleruby/918
2 parents 5b8837a + 8e4b54f commit b5e65db

File tree

162 files changed

+626
-586
lines changed

Some content is hidden

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

162 files changed

+626
-586
lines changed

spec/mspec/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ specs in a manner compatible with multiple Ruby implementations.
3838

3939
## Requirements
4040

41-
MSpec requires Ruby 2.3 or more recent.
41+
MSpec requires Ruby 2.4 or more recent.
4242

4343
## Bundler
4444

spec/mspec/lib/mspec/utils/script.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def self.get(key)
3939
end
4040

4141
def initialize
42-
ruby_version_is ""..."2.3" do
43-
abort "MSpec needs Ruby 2.3 or more recent"
42+
ruby_version_is ""..."2.4" do
43+
abort "MSpec needs Ruby 2.4 or more recent"
4444
end
4545

4646
config[:formatter] = nil

spec/ruby/.mspec.constants

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Find
7878
Forwardable
7979
GetoptLong
8080
HMACConstants
81-
HashStringsASCII8BIT
81+
HashStringsBinary
8282
HashStringsUSASCII
8383
HashStringsUTF8
8484
IPAddr

spec/ruby/command_line/dash_upper_k_spec.rb

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,24 @@
66
end
77

88
describe 'sets __ENCODING__ and Encoding.default_external' do
9-
it "to Encoding::ASCII_8BIT with -Ka" do
9+
it "to Encoding::BINARY with -Ka" do
1010
ruby_exe(@test_string, options: '-Ka').should ==
11-
[Encoding::ASCII_8BIT.name, Encoding::ASCII_8BIT.name, nil].inspect
11+
[Encoding::BINARY.name, Encoding::BINARY.name, nil].inspect
1212
end
1313

14-
it "to Encoding::ASCII_8BIT with -KA" do
14+
it "to Encoding::BINARY with -KA" do
1515
ruby_exe(@test_string, options: '-KA').should ==
16-
[Encoding::ASCII_8BIT.name, Encoding::ASCII_8BIT.name, nil].inspect
16+
[Encoding::BINARY.name, Encoding::BINARY.name, nil].inspect
1717
end
1818

19-
it "to Encoding::ASCII_8BIT with -Kn" do
19+
it "to Encoding::BINARY with -Kn" do
2020
ruby_exe(@test_string, options: '-Kn').should ==
21-
[Encoding::ASCII_8BIT.name, Encoding::ASCII_8BIT.name, nil].inspect
21+
[Encoding::BINARY.name, Encoding::BINARY.name, nil].inspect
2222
end
2323

24-
it "to Encoding::ASCII_8BIT with -KN" do
24+
it "to Encoding::BINARY with -KN" do
2525
ruby_exe(@test_string, options: '-KN').should ==
26-
[Encoding::ASCII_8BIT.name, Encoding::ASCII_8BIT.name, nil].inspect
26+
[Encoding::BINARY.name, Encoding::BINARY.name, nil].inspect
2727
end
2828

2929
it "to Encoding::EUC_JP with -Ke" do

spec/ruby/command_line/dash_x_spec.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,4 @@
1818
result = ruby_exe(embedded_ruby)
1919
result.should == "success\n"
2020
end
21-
22-
it "needs to be reviewed for spec completeness"
2321
end

spec/ruby/command_line/frozen_strings_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
describe "The --debug flag produces" do
2323
it "debugging info on attempted frozen string modification" do
2424
error_str = ruby_exe(fixture(__FILE__, 'debug_info.rb'), options: '--debug', args: "2>&1")
25-
error_str.should include("can't modify frozen String, created at ")
25+
error_str.should include("can't modify frozen String")
26+
error_str.should include("created at")
2627
error_str.should include("command_line/fixtures/debug_info.rb:2")
2728
end
2829
end

spec/ruby/command_line/shared/verbose.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
end
55

66
it "sets $VERBOSE to true" do
7-
ruby_exe(@script, options: @method).chomp.split.last.should == "true"
7+
ruby_exe(@script, options: @method).chomp.b.split.last.should == "true"
88
end
99
end

spec/ruby/core/argf/binmode_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@
3131
end
3232
end
3333

34-
it "sets the file's encoding to ASCII-8BIT" do
34+
it "sets the file's encoding to BINARY" do
3535
argf [@bin_file, @file1] do
3636
@argf.binmode
3737
@argf.binmode?.should == true
38-
@argf.gets.encoding.should == Encoding::ASCII_8BIT
38+
@argf.gets.encoding.should == Encoding::BINARY
3939
@argf.skip
40-
@argf.read.encoding.should == Encoding::ASCII_8BIT
40+
@argf.read.encoding.should == Encoding::BINARY
4141
end
4242
end
4343
end

spec/ruby/core/array/equal_value_spec.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@
4444
[obj].should == [5]
4545
end
4646

47-
# As per bug #1720
48-
it "returns false for [NaN] == [NaN]" do
49-
[nan_value].should_not == [nan_value]
47+
# See https://bugs.ruby-lang.org/issues/1720
48+
it "returns true for [NaN] == [NaN] because Array#== first checks with #equal? and NaN.equal?(NaN) is true" do
49+
[Float::NAN].should == [Float::NAN]
5050
end
5151
end

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,33 @@ def self.array_with_usascii_and_utf8_strings
3737
]
3838
end
3939

40-
def self.array_with_utf8_and_7bit_ascii8bit_strings
40+
def self.array_with_utf8_and_7bit_binary_strings
4141
[
4242
'bar',
4343
'báz',
44-
'foo'.force_encoding('ASCII-8BIT')
44+
'foo'.force_encoding('BINARY')
4545
]
4646
end
4747

48-
def self.array_with_utf8_and_ascii8bit_strings
48+
def self.array_with_utf8_and_binary_strings
4949
[
5050
'bar',
5151
'báz',
52-
[255].pack('C').force_encoding('ASCII-8BIT')
52+
[255].pack('C').force_encoding('BINARY')
5353
]
5454
end
5555

56-
def self.array_with_usascii_and_7bit_ascii8bit_strings
56+
def self.array_with_usascii_and_7bit_binary_strings
5757
[
5858
'bar'.force_encoding('US-ASCII'),
59-
'foo'.force_encoding('ASCII-8BIT')
59+
'foo'.force_encoding('BINARY')
6060
]
6161
end
6262

63-
def self.array_with_usascii_and_ascii8bit_strings
63+
def self.array_with_usascii_and_binary_strings
6464
[
6565
'bar'.force_encoding('US-ASCII'),
66-
[255].pack('C').force_encoding('ASCII-8BIT')
66+
[255].pack('C').force_encoding('BINARY')
6767
]
6868
end
6969
end

0 commit comments

Comments
 (0)