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
diff --git a/lib/rb/spec/deprecation_spec.rb b/lib/rb/spec/deprecation_spec.rb
index 9e27f7c..6c83ccd 100644
--- a/lib/rb/spec/deprecation_spec.rb
+++ b/lib/rb/spec/deprecation_spec.rb
@@ -231,6 +231,29 @@
       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