From fc311644864a8816cb874ef77d86bc84917c18ac Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Wed, 18 Jun 2008 01:01:57 +0000 Subject: [PATCH] Add (currently failing) spec for information leak between deprecations git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668929 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/spec/deprecation_spec.rb | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/lib/rb/spec/deprecation_spec.rb b/lib/rb/spec/deprecation_spec.rb index 9e27f7c4..6c83ccd1 100644 --- a/lib/rb/spec/deprecation_spec.rb +++ b/lib/rb/spec/deprecation_spec.rb @@ -231,6 +231,29 @@ describe "deprecate_class!" do subklass.new.foo.should == "subclass foo" end end + + it "should not bleed info between deprecations" do + ensure_const_removed :DeprecationSpecOldClass do + ensure_const_removed :DeprecationSpecOldClass2 do + klass = Class.new do + def foo + "foo" + end + end + deprecate_class! :DeprecationSpecOldClass => klass + klass2 = Class.new do + def bar + "bar" + end + end + deprecate_class! :DeprecationSpecOldClass2 => klass2 + stub_stderr(:DeprecationSpecOldClass) + ::DeprecationSpecOldClass.new.foo.should == "foo" + stub_stderr(:DeprecationSpecOldClass2) + ::DeprecationSpecOldClass2.new.bar.should == "bar" + end + end + end end describe "deprecate_module!" do -- 2.17.1