summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHiroshi SHIBATA <hsbt@ruby-lang.org>2023-07-18 11:32:44 +0900
committergit <svn-admin@ruby-lang.org>2023-07-18 02:55:47 +0000
commitb368990ce632aaa11581d3b8f9fa9fd77401121a (patch)
treee8b46b40cc4173bea5e9d2cc477b941a9eb876a4 /test
parentf302e725e10ae05e613e2c24cae0741f65f2db91 (diff)
[ruby/psych] Skip BigDecimal tests when it's missing to load
https://github.com/ruby/psych/commit/e1dbfae7a6
Diffstat (limited to 'test')
-rw-r--r--test/psych/test_numeric.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/test/psych/test_numeric.rb b/test/psych/test_numeric.rb
index 9c75c016cd..4c012e4562 100644
--- a/test/psych/test_numeric.rb
+++ b/test/psych/test_numeric.rb
@@ -1,6 +1,9 @@
# frozen_string_literal: true
require_relative 'helper'
-require 'bigdecimal'
+begin
+ require 'bigdecimal'
+rescue LoadError
+end
module Psych
###
@@ -29,13 +32,13 @@ module Psych
def test_big_decimal_tag
decimal = BigDecimal("12.34")
assert_match "!ruby/object:BigDecimal", Psych.dump(decimal)
- end
+ end if defined?(BigDecimal)
def test_big_decimal_round_trip
decimal = BigDecimal("12.34")
$DEBUG = false
assert_cycle decimal
- end
+ end if defined?(BigDecimal)
def test_does_not_attempt_numeric
str = Psych.load('--- 4 roses')