ruby-changes:63061
From: Yusuke <ko1@a...>
Date: Thu, 24 Sep 2020 19:31:10 +0900 (JST)
Subject: [ruby-changes:63061] 4405423c87 (master): test/ostruct/test_ostruct.rb: Prevent "method redefined; discarding old foo"
https://git.ruby-lang.org/ruby.git/commit/?id=4405423c87 From 4405423c871698c36e4e4f24d89f17033b18b19c Mon Sep 17 00:00:00 2001 From: Yusuke Endoh <mame@r...> Date: Thu, 24 Sep 2020 19:30:22 +0900 Subject: test/ostruct/test_ostruct.rb: Prevent "method redefined; discarding old foo" diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index 8fa7ba6..0628094 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -184,12 +184,15 @@ class TC_OpenStruct < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ostruct/test_ostruct.rb#L184 end def test_does_not_redefine + $VERBOSE, verbose_bak = nil, $VERBOSE os = OpenStruct.new(foo: 42) def os.foo 43 end os.foo = 44 assert_equal(43, os.foo) + ensure + $VERBOSE = verbose_bak end def test_allocate_subclass -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/