git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668916
13f79535-47bb-0310-9956-
ffa450edef68
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