diff options
author | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-12 22:15:31 -0800 |
---|---|---|
committer | Takashi Kokubun <takashikkbn@gmail.com> | 2022-11-12 22:15:40 -0800 |
commit | 18fa7059e83d6c1afa32c4b331ca254da452a36a (patch) | |
tree | 9a534a5e738a547175cb750e42a8f8f2363881c8 /spec/ruby | |
parent | 802dce4acd97234bef88fe4bbb98db5ab90c45d9 (diff) | |
download | ruby-18fa7059e83d6c1afa32c4b331ca254da452a36a.tar.gz |
Deal with different Ruby versions
Diffstat (limited to 'spec/ruby')
-rw-r--r-- | spec/ruby/library/bigdecimal/round_spec.rb | 12 |
1 files 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 -> { 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 |