Add another spec for deprecate!
authorKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:58:04 +0000 (00:58 +0000)
committerKevin Clark <kclark@apache.org>
Wed, 18 Jun 2008 00:58:04 +0000 (00:58 +0000)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668916 13f79535-47bb-0310-9956-ffa450edef68

lib/rb/spec/deprecation_spec.rb

index 08e1504..bec299c 100644 (file)
@@ -151,6 +151,18 @@ describe 'deprecate!' do
     stub_stderr("#{klass.inspect}#old")
     klass.new.old.should == "new 2"
   end
+
+  it "should call the forwarded method in the same context as the original" do
+    klass = Class.new do
+      def myself
+        self
+      end
+      deprecate! :me => :myself
+    end
+    inst = klass.new
+    stub_stderr("#{klass.inspect}#me")
+    inst.me.should eql(inst.myself)
+  end
 end
 
 describe "deprecate_class!" do