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/server_socket_spec.rb b/lib/rb/spec/server_socket_spec.rb
index 071acba..1301d54 100644
--- a/lib/rb/spec/server_socket_spec.rb
+++ b/lib/rb/spec/server_socket_spec.rb
@@ -17,15 +17,14 @@
# 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 ThriftServerSocketSpec < Spec::ExampleGroup
- include Thrift
+describe 'Thrift::ServerSocket' do
- describe ServerSocket do
+ describe Thrift::ServerSocket do
before(:each) do
- @socket = ServerSocket.new(1234)
+ @socket = Thrift::ServerSocket.new(1234)
end
it "should create a handle when calling listen" do
@@ -34,7 +33,7 @@
end
it "should accept an optional host argument" do
- @socket = ServerSocket.new('localhost', 1234)
+ @socket = Thrift::ServerSocket.new('localhost', 1234)
TCPServer.should_receive(:new).with('localhost', 1234)
@socket.listen
end
@@ -46,7 +45,7 @@
sock = mock("sock")
handle.should_receive(:accept).and_return(sock)
trans = mock("Socket")
- Socket.should_receive(:new).and_return(trans)
+ Thrift::Socket.should_receive(:new).and_return(trans)
trans.should_receive(:handle=).with(sock)
@socket.accept.should == trans
end