diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-01-28 14:42:38 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-01-28 14:42:38 +0100 |
commit | e0c5488ff9308b1a16718c64bc9096caca88ed83 (patch) | |
tree | b0ede98f96c4477c470bef45547abff525215b21 /spec/ruby/core/integer/chr_spec.rb | |
parent | bb5f71088774b14c96fe11718e5e1b7ffb20fff2 (diff) |
Update to ruby/spec@902ab83
Diffstat (limited to 'spec/ruby/core/integer/chr_spec.rb')
-rw-r--r-- | spec/ruby/core/integer/chr_spec.rb | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/ruby/core/integer/chr_spec.rb b/spec/ruby/core/integer/chr_spec.rb index 9f105e4241..a919d29f12 100644 --- a/spec/ruby/core/integer/chr_spec.rb +++ b/spec/ruby/core/integer/chr_spec.rb @@ -11,7 +11,11 @@ describe "Integer#chr without argument" do it "raises a RangeError is self is less than 0" do -> { -1.chr }.should raise_error(RangeError) - -> { -bignum_value.chr }.should raise_error(RangeError) + -> { (-bignum_value).chr }.should raise_error(RangeError) + end + + it "raises a RangeError if self is too large" do + -> { 2206368128.chr(Encoding::UTF_8) }.should raise_error(RangeError) end describe "when Encoding.default_internal is nil" do @@ -162,7 +166,7 @@ describe "Integer#chr with an encoding argument" do # http://redmine.ruby-lang.org/issues/4869 it "raises a RangeError is self is less than 0" do -> { -1.chr(Encoding::UTF_8) }.should raise_error(RangeError) - -> { -bignum_value.chr(Encoding::EUC_JP) }.should raise_error(RangeError) + -> { (-bignum_value).chr(Encoding::EUC_JP) }.should raise_error(RangeError) end it "raises a RangeError if self is too large" do |