Thrift-1644:Upgrade RSpec to 2.11.x and refactor specs as needed
Client: rb
Patch: Nathan Beyer

Upgrading to rspec2.



git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1391280 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/rb/spec/unix_socket_spec.rb b/lib/rb/spec/unix_socket_spec.rb
index 43818e0..cb6cff3 100644
--- a/lib/rb/spec/unix_socket_spec.rb
+++ b/lib/rb/spec/unix_socket_spec.rb
@@ -17,16 +17,15 @@
 # under the License.
 #
 
-require File.expand_path("#{File.dirname(__FILE__)}/spec_helper")
+require 'spec_helper'
 require File.expand_path("#{File.dirname(__FILE__)}/socket_spec_shared")
 
-class ThriftUNIXSocketSpec < Spec::ExampleGroup
-  include Thrift
+describe 'UNIXSocket' do
 
-  describe UNIXSocket do
+  describe Thrift::UNIXSocket do
     before(:each) do
       @path = '/tmp/thrift_spec_socket'
-      @socket = UNIXSocket.new(@path)
+      @socket = Thrift::UNIXSocket.new(@path)
       @handle = mock("Handle", :closed? => false)
       @handle.stub!(:close)
       ::UNIXSocket.stub!(:new).and_return(@handle)
@@ -41,14 +40,14 @@
 
     it "should accept an optional timeout" do
       ::UNIXSocket.stub!(:new)
-      UNIXSocket.new(@path, 5).timeout.should == 5
+      Thrift::UNIXSocket.new(@path, 5).timeout.should == 5
     end
   end
 
-  describe UNIXServerSocket do
+  describe Thrift::UNIXServerSocket do
     before(:each) do
       @path = '/tmp/thrift_spec_socket'
-      @socket = UNIXServerSocket.new(@path)
+      @socket = Thrift::UNIXServerSocket.new(@path)
     end
 
     it "should create a handle when calling listen" do
@@ -63,7 +62,7 @@
       sock = mock("sock")
       handle.should_receive(:accept).and_return(sock)
       trans = mock("UNIXSocket")
-      UNIXSocket.should_receive(:new).and_return(trans)
+      Thrift::UNIXSocket.should_receive(:new).and_return(trans)
       trans.should_receive(:handle=).with(sock)
       @socket.accept.should == trans
     end