From dfb1a7122250bba977fee5d27226a2226b0fc62a Mon Sep 17 00:00:00 2001 From: marcandre Date: Wed, 22 Feb 2012 18:59:03 +0000 Subject: * lib/ostruct.rb (delete_field): Bug fix so previous value is returned. Patch by Nick Recobra [Bug #6063] * test/ostruct/test_ostruct.rb: Test for above git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34755 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ostruct/test_ostruct.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/ostruct/test_ostruct.rb') diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index db8e7415eb..dca2382b2b 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -57,9 +57,10 @@ class TC_OpenStruct < Test::Unit::TestCase o.a = 'a' assert_respond_to(o, :a) assert_respond_to(o, :a=) - o.delete_field :a + a = o.delete_field :a assert_not_respond_to(o, :a, bug) assert_not_respond_to(o, :a=, bug) + assert_equal(a, 'a') end def test_method_missing_handles_square_bracket_equals -- cgit v1.2.3