THRIFT-374. rb: ruby 1.9 compatibility
This patch updates the thrift_native package to use 1.9 compatible macros and fixes the pure ruby stuff to behave equally well in ruby1.8.6-ruby1.9.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758435 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/server_spec.rb b/lib/rb/spec/server_spec.rb
index 545ea28..874085c 100644
--- a/lib/rb/spec/server_spec.rb
+++ b/lib/rb/spec/server_spec.rb
@@ -39,9 +39,9 @@
x = 0
@processor.should_receive(:process).exactly(3).times.with(@prot, @prot).and_return do
case (x += 1)
- when 1: raise Thrift::TransportException
- when 2: raise Thrift::ProtocolException
- when 3: throw :stop
+ when 1 then raise Thrift::TransportException
+ when 2 then raise Thrift::ProtocolException
+ when 3 then throw :stop
end
end
@trans.should_receive(:close).exactly(3).times
@@ -66,9 +66,9 @@
x = 0
@processor.should_receive(:process).exactly(3).times.with(@prot, @prot).and_return do
case (x += 1)
- when 1: raise Thrift::TransportException
- when 2: raise Thrift::ProtocolException
- when 3: throw :stop
+ when 1 then raise Thrift::TransportException
+ when 2 then raise Thrift::ProtocolException
+ when 3 then throw :stop
end
end
@trans.should_receive(:close).exactly(3).times
@@ -127,9 +127,9 @@
error = RuntimeError.new("Stopped")
@processor.should_receive(:process).exactly(3).times.with(@prot, @prot).and_return do
case (x += 1)
- when 1: raise Thrift::TransportException
- when 2: raise Thrift::ProtocolException
- when 3: raise error
+ when 1 then raise Thrift::TransportException
+ when 2 then raise Thrift::ProtocolException
+ when 3 then raise error
end
end
@trans.should_receive(:close).exactly(3).times