Sha256: c0d4a603dab9831e8a40013fe864cea55f9e8f4a98853ddc9582ec64061ad117

Contents?: true

Size: 1.17 KB

Versions: 7

Compression:

Stored size: 1.17 KB

Contents

%i(inproc ipc tcp pgm epgm).each do |transport|
  %i(bind connect).each do |mode|
    context "Sockets with #{ transport } transport in #{ mode } mode" do
      setup do
        options = { transport: transport }
        opposing_mode = %i(bind connect).reject { |m| m == mode }.first
        @unimportant = EZMQ::Socket.new opposing_mode, ZMQ::PAIR, options
        @socket = EZMQ::Socket.new mode, ZMQ::PAIR, options
      end

      should 'instantiate properly' do
        assert_kind_of EZMQ::Socket, @socket
      end

      should 'expose their contexts' do
        assert_kind_of EZMQ::Context, @socket.context
      end

      should 'have a bind method' do
        assert @socket.respond_to? :bind
      end

      should 'have a connect method' do
        assert @socket.respond_to? :connect
      end

      should 'have a send method' do
        assert @socket.respond_to? :send
      end

      should 'have a receive method' do
        assert @socket.respond_to? :receive
      end

      should 'have an encode method' do
        assert @socket.respond_to? :encode
      end

      should 'have a decode method' do
        assert @socket.respond_to? :decode
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ezmq-0.4.12 tests/ezmq/socket.rb
ezmq-0.4.11 tests/ezmq/socket.rb
ezmq-0.4.4 tests/ezmq/socket.rb
ezmq-0.4.3 tests/ezmq/socket.rb
ezmq-0.4.2 tests/ezmq/socket.rb
ezmq-0.4.1 tests/ezmq/socket.rb
ezmq-0.4.0 tests/ezmq/socket.rb