aboutsummaryrefslogtreecommitdiffstats
path: root/spec/ruby
diff options
context:
space:
mode:
authorPeter Zhu <peter@peterzhu.ca>2023-05-29 10:45:31 -0400
committerPeter Zhu <peter@peterzhu.ca>2023-05-29 11:55:39 -0400
commitb7a26dfa16228cdfeb7e635df1e4f711908c667c (patch)
tree4990a51068ceda8097098d1755598f6de518d53e /spec/ruby
parentc48d496e8cfdf8243d2beb28623954003adaf7fc (diff)
downloadruby-b7a26dfa16228cdfeb7e635df1e4f711908c667c.tar.gz
Unify error messages of rb_num2ulong and rb_num2ull
The error messages were slightly different due, which causes different behaviour on 32-bit and 64-bit systems.
Diffstat (limited to 'spec/ruby')
-rw-r--r--spec/ruby/core/time/new_spec.rb9
1 files changed, 8 insertions, 1 deletions
diff --git a/spec/ruby/core/time/new_spec.rb b/spec/ruby/core/time/new_spec.rb
index d95c82b20a..6a39cf7ce0 100644
--- a/spec/ruby/core/time/new_spec.rb
+++ b/spec/ruby/core/time/new_spec.rb
@@ -523,9 +523,16 @@ describe "Time.new with a timezone argument" do
end
it "raise TypeError is can't convert precision keyword argument into Integer" do
+ error_msg =
+ if "3.3" <= RUBY_VERSION
+ "no implicit conversion of String into Integer"
+ else
+ "no implicit conversion from string"
+ end
+
-> {
Time.new("2021-12-25 00:00:00.123456789876 +09:00", precision: "")
- }.should raise_error(TypeError, "no implicit conversion from string")
+ }.should raise_error(TypeError, error_msg)
end
it "raises ArgumentError if part of time string is missing" do