Sha256: c9c0196d40dcf121f3397e37e87b81e21453adacfd5fc3e49d889a5dd7aa5030

Contents?: true

Size: 765 Bytes

Versions: 4

Compression:

Stored size: 765 Bytes

Contents

context 'Clients' do
  setup do
    @context = EZMQ::Context.new
    options = { transport: :inproc, address: 'test', context: @context }
    @server = EZMQ::Server.new options
    @client = EZMQ::Client.new options
    Thread.new do
      @server.listen
    end
  end

  should 'return the length of messages they send' do
    assert_equal 7, @client.send('message')
  end

  should 'return the contents of messages they receive' do
    @client.send 'message'
    assert_equal 'message', @client.receive
  end

  should 'return the reply from a request they send' do
    assert_equal 'message', @client.request('message')
  end

  should 'yield the contents of reply, if given a block' do
    assert_equal 'message', @client.request('message') { |m| m }
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ezmq-0.4.3 tests/ezmq/request.rb
ezmq-0.4.2 tests/ezmq/request.rb
ezmq-0.4.1 tests/ezmq/request.rb
ezmq-0.4.0 tests/ezmq/request.rb