summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--test/ostruct/test_ostruct.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb
index 8fa7ba6229..0628094306 100644
--- a/test/ostruct/test_ostruct.rb
+++ b/test/ostruct/test_ostruct.rb
@@ -184,12 +184,15 @@ class TC_OpenStruct < Test::Unit::TestCase
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