Sha256: 82a1709468b59789cd02efe17528ab9e971c35546a284b541a9bc76bbcb41785

Contents?: true

Size: 955 Bytes

Versions: 13

Compression:

Stored size: 955 Bytes

Contents

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

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
    @runner.should respond_to(:stop)
  end

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

  it "signals the Server is running" do
    @server.should be_running
  end

end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
protobuffy-3.6.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuffy-3.5.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuffy-3.4.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuffy-3.3.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuffy-3.2.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuffy-3.1.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.3 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.0 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.0.rc2 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-3.0.0.rc1 spec/lib/protobuf/rpc/servers/socket_server_spec.rb