[前][次][番号順一覧][スレッド一覧]

ruby-changes:74471

From: Takashi <ko1@a...>
Date: Sun, 13 Nov 2022 15:16:19 +0900 (JST)
Subject: [ruby-changes:74471] 18fa7059e8 (master): Deal with different Ruby versions

https://git.ruby-lang.org/ruby.git/commit/?id=18fa7059e8

From 18fa7059e83d6c1afa32c4b331ca254da452a36a Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Sat, 12 Nov 2022 22:15:31 -0800
Subject: Deal with different Ruby versions

---
 spec/ruby/library/bigdecimal/round_spec.rb | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/spec/ruby/library/bigdecimal/round_spec.rb b/spec/ruby/library/bigdecimal/round_spec.rb
index caf68afa04..bfc6dbc763 100644
--- a/spec/ruby/library/bigdecimal/round_spec.rb
+++ b/spec/ruby/library/bigdecimal/round_spec.rb
@@ -228,7 +228,15 @@ describe "BigDecimal#round" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/library/bigdecimal/round_spec.rb#L228
     -> { BigDecimal('-Infinity').round(2) }.should_not raise_error(FloatDomainError)
   end
 
-  it "raise for a non-existent round mode" do
-    -> { @p1_50.round(0, :nonsense) }.should raise_error(ArgumentError, "invalid rounding mode (nonsense)")
+  ruby_version_is ''...'3.2' do
+    it 'raise for a non-existent round mode' do
+      -> { @p1_50.round(0, :nonsense) }.should raise_error(ArgumentError, "invalid rounding mode")
+    end
+  end
+
+  ruby_version_is '3.2' do
+    it 'raise for a non-existent round mode' do
+      -> { @p1_50.round(0, :nonsense) }.should raise_error(ArgumentError, "invalid rounding mode (nonsense)")
+    end
   end
 end
-- 
cgit v1.2.3


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]