From da40e8d27c1f4a8c2f341927cacdccd1038bd467 Mon Sep 17 00:00:00 2001 From: Kevin Clark Date: Wed, 18 Jun 2008 00:58:04 +0000 Subject: [PATCH] Add another spec for deprecate! git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@668916 13f79535-47bb-0310-9956-ffa450edef68 --- lib/rb/spec/deprecation_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 -- 2.17.1