Sha256: 0f91c90c5a7de052498919c036a98ac3aa46c229aacff5ab0207a5d5a850ecc8

Contents?: true

Size: 973 Bytes

Versions: 12

Compression:

Stored size: 973 Bytes

Contents

require 'spec_helper'
require 'spec/support/test/resource_service'
require 'protobuf/rpc/servers/socket_runner'
require 'protobuf/socket'

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) { |runner| 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

12 entries across 12 versions & 2 rubygems

Version Path
protobuf-3.5.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.5.3 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.5.2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.5.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
prepor-protobuf-3.5.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
prepor-protobuf-3.5.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.5.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.4.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.4.3 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.4.2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.4.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.4.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb