diff options
Diffstat (limited to 'spec/ruby/library/socket/tcpserver')
4 files changed, 15 insertions, 15 deletions
diff --git a/spec/ruby/library/socket/tcpserver/initialize_spec.rb b/spec/ruby/library/socket/tcpserver/initialize_spec.rb index 9a55cf17e2..412bdbfb9d 100644 --- a/spec/ruby/library/socket/tcpserver/initialize_spec.rb +++ b/spec/ruby/library/socket/tcpserver/initialize_spec.rb @@ -2,7 +2,7 @@ require_relative '../spec_helper' require_relative '../fixtures/classes' describe 'TCPServer#initialize' do - describe 'with a single Fixnum argument' do + describe 'with a single Integer argument' do before do @server = TCPServer.new(0) end @@ -12,7 +12,7 @@ describe 'TCPServer#initialize' do end it 'sets the port to the given argument' do - @server.local_address.ip_port.should be_an_instance_of(Fixnum) + @server.local_address.ip_port.should be_kind_of(Integer) @server.local_address.ip_port.should > 0 end @@ -38,7 +38,7 @@ describe 'TCPServer#initialize' do end it 'sets the port to the given argument' do - @server.local_address.ip_port.should be_an_instance_of(Fixnum) + @server.local_address.ip_port.should be_kind_of(Integer) @server.local_address.ip_port.should > 0 end @@ -56,7 +56,7 @@ describe 'TCPServer#initialize' do end end - describe 'with a String and a Fixnum' do + describe 'with a String and an Integer' do SocketSpecs.each_ip_protocol do |family, ip_address| before do @server = TCPServer.new(ip_address, 0) @@ -67,7 +67,7 @@ describe 'TCPServer#initialize' do end it 'sets the port to the given port argument' do - @server.local_address.ip_port.should be_an_instance_of(Fixnum) + @server.local_address.ip_port.should be_kind_of(Integer) @server.local_address.ip_port.should > 0 end @@ -90,7 +90,7 @@ describe 'TCPServer#initialize' do end it 'sets the port to the given port argument' do - @server.local_address.ip_port.should be_an_instance_of(Fixnum) + @server.local_address.ip_port.should be_kind_of(Integer) @server.local_address.ip_port.should > 0 end diff --git a/spec/ruby/library/socket/tcpserver/listen_spec.rb b/spec/ruby/library/socket/tcpserver/listen_spec.rb index 1e17de06f1..e266decd61 100644 --- a/spec/ruby/library/socket/tcpserver/listen_spec.rb +++ b/spec/ruby/library/socket/tcpserver/listen_spec.rb @@ -15,7 +15,7 @@ describe 'TCPServer#listen' do @server.listen(1).should == 0 end - it "raises when the given argument can't be coerced to a Fixnum" do + it "raises when the given argument can't be coerced to an Integer" do lambda { @server.listen('cats') }.should raise_error(TypeError) end end diff --git a/spec/ruby/library/socket/tcpserver/new_spec.rb b/spec/ruby/library/socket/tcpserver/new_spec.rb index 94033411e3..4717b95a2c 100644 --- a/spec/ruby/library/socket/tcpserver/new_spec.rb +++ b/spec/ruby/library/socket/tcpserver/new_spec.rb @@ -10,7 +10,7 @@ describe "TCPServer.new" do @server = TCPServer.new('127.0.0.1', 0) addr = @server.addr addr[0].should == 'AF_INET' - addr[1].should be_kind_of(Fixnum) + addr[1].should be_kind_of(Integer) # on some platforms (Mac), MRI # returns comma at the end. addr[2].should =~ /^#{SocketSpecs.hostname}\b/ @@ -20,7 +20,7 @@ describe "TCPServer.new" do it "binds to localhost and a port with either IPv4 or IPv6" do @server = TCPServer.new(SocketSpecs.hostname, 0) addr = @server.addr - addr[1].should be_kind_of(Fixnum) + addr[1].should be_kind_of(Integer) if addr[0] == 'AF_INET' addr[2].should =~ /^#{SocketSpecs.hostname}\b/ addr[3].should == '127.0.0.1' @@ -34,7 +34,7 @@ describe "TCPServer.new" do @server = TCPServer.new('', 0) addr = @server.addr addr[0].should == 'AF_INET' - addr[1].should be_kind_of(Fixnum) + addr[1].should be_kind_of(Integer) addr[2].should == '0.0.0.0' addr[3].should == '0.0.0.0' end @@ -43,7 +43,7 @@ describe "TCPServer.new" do @server = TCPServer.new('', 0) addr = @server.addr addr[0].should == 'AF_INET' - addr[1].should be_kind_of(Fixnum) + addr[1].should be_kind_of(Integer) addr[2].should == '0.0.0.0' addr[3].should == '0.0.0.0' end @@ -56,7 +56,7 @@ describe "TCPServer.new" do @server = TCPServer.new(SocketSpecs.hostname, port) addr = @server.addr - addr[1].should be_kind_of(Fixnum) + addr[1].should be_kind_of(Integer) # TODO: This should also accept strings like 'https', but I don't know how to # pick such a service port that will be able to reliably bind... diff --git a/spec/ruby/library/socket/tcpserver/sysaccept_spec.rb b/spec/ruby/library/socket/tcpserver/sysaccept_spec.rb index 144b6806f1..5543b67755 100644 --- a/spec/ruby/library/socket/tcpserver/sysaccept_spec.rb +++ b/spec/ruby/library/socket/tcpserver/sysaccept_spec.rb @@ -21,7 +21,7 @@ describe "TCPServer#sysaccept" do fd = @server.sysaccept - fd.should be_an_instance_of(Fixnum) + fd.should be_kind_of(Integer) ensure sock.close if sock && !sock.closed? IO.for_fd(fd).close if fd @@ -55,10 +55,10 @@ describe 'TCPServer#sysaccept' do @client.close end - it 'returns a new file descriptor as a Fixnum' do + it 'returns a new file descriptor as an Integer' do @fd = @server.sysaccept - @fd.should be_an_instance_of(Fixnum) + @fd.should be_kind_of(Integer) @fd.should_not == @client.fileno end end |