From b368990ce632aaa11581d3b8f9fa9fd77401121a Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 18 Jul 2023 11:32:44 +0900 Subject: [PATCH] [ruby/psych] Skip BigDecimal tests when it's missing to load https://github.com/ruby/psych/commit/e1dbfae7a6 --- test/psych/test_numeric.rb | 9 ++++++--- 1 file 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')