Sha256: 8d67b95040eceb2431bd290cd99b77da813f6e6ad825a9a8217258c4c57c3419
Contents?: true
Size: 1.06 KB
Versions: 30
Compression:
Stored size: 1.06 KB
Contents
require 'spec_helper' class UtilTest include ::Protobuf::Rpc::Zmq::Util end describe ::Protobuf::Rpc::Zmq::Util do before(:each) do load 'protobuf/zmq.rb' end subject { UtilTest.new } describe '#zmq_error_check' do it 'raises when the error code is less than 0' do expect { subject.zmq_error_check(-1, :test) }.to raise_error(/test/) end it 'retrieves the error string from ZeroMQ' do ZMQ::Util.stub(:error_string).and_return('an error from zmq') expect { subject.zmq_error_check(-1, :test) }.to raise_error(RuntimeError, /an error from zmq/i) end it 'does nothing if the error code is > 0' do expect { subject.zmq_error_check(1, :test) }.to_not raise_error end it 'does nothing if the error code is == 0' do expect { subject.zmq_error_check(0, :test) }.to_not raise_error end end describe '#log_signature' do it 'returns the signature for the log' do subject.log_signature.should include('server', 'UtilTest') end end end
Version data entries
30 entries across 30 versions & 1 rubygems