Author: kclark
Date: Thu Jun 26 11:45:29 2008
New Revision: 671985

URL: http://svn.apache.org/viewvc?rev=671985&view=rev
Log:
rb: Ensure the specs that expect deprecation warnings actually get them 
[THRIFT-56]

Author: Kevin Ballard <[EMAIL PROTECTED]>

Modified:
    incubator/thrift/trunk/lib/rb/lib/thrift/deprecation.rb
    incubator/thrift/trunk/lib/rb/spec/backwards_compatibility_spec.rb
    incubator/thrift/trunk/lib/rb/spec/deprecation_spec.rb

Modified: incubator/thrift/trunk/lib/rb/lib/thrift/deprecation.rb
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/lib/thrift/deprecation.rb?rev=671985&r1=671984&r2=671985&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/lib/thrift/deprecation.rb (original)
+++ incubator/thrift/trunk/lib/rb/lib/thrift/deprecation.rb Thu Jun 26 11:45:29 
2008
@@ -123,6 +123,10 @@
     dir = File.dirname(__FILE__)
     stack.find { |frame| frame[0,dir.size] != dir }
   end
+  def self.reset_deprecation_warnings
+    CLASS_MAPPING.each { |k,v| v[2] = false }
+    MODULE_MAPPING.each { |k,v| v[2] = false }
+  end
 end
 
 module Kernel

Modified: incubator/thrift/trunk/lib/rb/spec/backwards_compatibility_spec.rb
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/backwards_compatibility_spec.rb?rev=671985&r1=671984&r2=671985&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/backwards_compatibility_spec.rb 
(original)
+++ incubator/thrift/trunk/lib/rb/spec/backwards_compatibility_spec.rb Thu Jun 
26 11:45:29 2008
@@ -5,6 +5,7 @@
 
 context "Backwards compatibility" do
   specify "old class names should map to new classes" do
+    Thrift::DeprecationProxy.reset_deprecation_warnings
     # use an Array because a Hash will call #hash and trigger deprecation 
warnings
     klasses = [
       [:module, :ThriftClient,               Thrift::Client],

Modified: incubator/thrift/trunk/lib/rb/spec/deprecation_spec.rb
URL: 
http://svn.apache.org/viewvc/incubator/thrift/trunk/lib/rb/spec/deprecation_spec.rb?rev=671985&r1=671984&r2=671985&view=diff
==============================================================================
--- incubator/thrift/trunk/lib/rb/spec/deprecation_spec.rb (original)
+++ incubator/thrift/trunk/lib/rb/spec/deprecation_spec.rb Thu Jun 26 11:45:29 
2008
@@ -14,6 +14,10 @@
     Thrift.const_set :DEPRECATION, false
   end
 
+  before(:each) do
+    Thrift::DeprecationProxy.reset_deprecation_warnings
+  end
+
   def ensure_const_removed(name, &block)
     begin
       block.call


Reply via email to