From: Kevin Clark Date: Wed, 18 Jun 2008 00:58:04 +0000 (+0000) Subject: Add another spec for deprecate! X-Git-Tag: 0.2.0~633 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=da40e8d27c1f4a8c2f341927cacdccd1038bd467;p=common%2Fthrift.git Add another spec for deprecate! git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668916 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/rb/spec/deprecation_spec.rb b/lib/rb/spec/deprecation_spec.rb index 08e1504d..bec299c6 100644 --- a/lib/rb/spec/deprecation_spec.rb +++ b/lib/rb/spec/deprecation_spec.rb @@ -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