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

ruby-changes:59954

From: S.H <ko1@a...>
Date: Fri, 7 Feb 2020 19:36:14 +0900 (JST)
Subject: [ruby-changes:59954] 38ed8cbb5f (master): remove warning & support multi-run test for test/psych/visitors/test_to_ruby.rb (#2881)

https://git.ruby-lang.org/ruby.git/commit/?id=38ed8cbb5f

From 38ed8cbb5f77d0fd67ae4aadc6a978b303d3c0e9 Mon Sep 17 00:00:00 2001
From: "S.H" <gamelinks007@g...>
Date: Fri, 7 Feb 2020 19:35:52 +0900
Subject: remove warning & support multi-run test for
 test/psych/visitors/test_to_ruby.rb (#2881)


diff --git a/test/psych/visitors/test_to_ruby.rb b/test/psych/visitors/test_to_ruby.rb
index f342bf0..0ebfe9b 100644
--- a/test/psych/visitors/test_to_ruby.rb
+++ b/test/psych/visitors/test_to_ruby.rb
@@ -24,6 +24,7 @@ module Psych https://github.com/ruby/ruby/blob/trunk/test/psych/visitors/test_to_ruby.rb#L24
       end
 
       def test_legacy_struct
+        Struct.send(:remove_const, AWESOME) if Struct.const_defined?(:AWESOME)
         foo = Struct.new('AWESOME', :bar)
         assert_equal foo.new('baz'), Psych.load(<<-eoyml)
 !ruby/struct:AWESOME
-- 
cgit v0.10.2


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

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