Sha256: a04d9a666784a97579cbec150757d9d56c656b2c117f556334ebb26ca5ba608e

Contents?: true

Size: 957 Bytes

Versions: 49

Compression:

Stored size: 957 Bytes

Contents

require 'spec_helper'
require 'protobuf/rpc/servers/socket_runner'
require 'protobuf/socket'
require SUPPORT_PATH.join('resource_service')

RSpec.describe Protobuf::Rpc::Socket::Server do
  before(:each) do
    load 'protobuf/socket.rb'
  end

  before(:all) do
    load 'protobuf/socket.rb'
    Thread.abort_on_exception = true
    @options = OpenStruct.new(:host => "127.0.0.1", :port => 9399, :backlog => 100, :threshold => 100)
    @runner = ::Protobuf::Rpc::SocketRunner.new(@options)
    @server = @runner.instance_variable_get(:@server)
    @server_thread = Thread.new(@runner, &:run)
    Thread.pass until @server.running?
  end

  after(:all) do
    @server.stop
    @server_thread.join
  end

  it "Runner provides a stop method" do
    expect(@runner).to respond_to(:stop)
  end

  it "provides a stop method" do
    expect(@server).to respond_to(:stop)
  end

  it "signals the Server is running" do
    expect(@server).to be_running
  end

end

Version data entries

49 entries across 49 versions & 3 rubygems

Version Path
protobuf-3.10.9 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.8 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.7 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.6 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.5 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-cucumber-3.10.8 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-cucumber-3.10.7 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-cucumber-3.10.6 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-cucumber-3.10.5 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-cucumber-3.10.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.3 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.10.0.pre0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.9.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.9.0.pre2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.9.0.pre spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.8.5 spec/lib/protobuf/rpc/servers/socket_server_spec.rb