Sha256: a8d8ef45a2715182a726734d928f505d8b5b2b8e1f44cccc3ecdc4a5740c155d

Contents?: true

Size: 1.22 KB

Versions: 89

Compression:

Stored size: 1.22 KB

Contents

require 'spec_helper'
require 'spec/support/test/resource_service'
require 'protobuf/rpc/servers/socket_runner'
require 'protobuf/evented'
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
    server = OpenStruct.new(:server => "127.0.0.1", :port => 9399, :backlog => 100, :threshold => 100)
    @server_thread = Thread.new(server) { |s| Protobuf::Rpc::SocketRunner.run(s) }
    Thread.pass until Protobuf::Rpc::Socket::Server.running?
  end

  after(:all) do
    Protobuf::Rpc::SocketRunner.stop
    @server_thread.join
  end

  it "Runner provides a stop method" do
    runner_class = described_class.to_s.gsub(/Evented::Server/, "EventedRunner").constantize
    runner_class.respond_to?(:stop).should be_true
  end

  it "provides a stop method" do
    described_class.respond_to?(:stop).should be_true
  end

  it "provides a Runner class" do
    runner_class = described_class.to_s.gsub(/Evented::Server/, "EventedRunner")
    expect { runner_class.constantize }.to_not raise_error
  end

  it "signals the Server is running" do
    described_class.running?.should be_true
  end

end

Version data entries

89 entries across 89 versions & 1 rubygems

Version Path
protobuf-2.7.12 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.11-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.11 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.10-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.10 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.9-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.9 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.8-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.8 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.7-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.7 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.6-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.6 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.5-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.5 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.4-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.4 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.3-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.3 spec/lib/protobuf/rpc/servers/socket_server_spec.rb
protobuf-2.7.2-java spec/lib/protobuf/rpc/servers/socket_server_spec.rb