File: util_spec.rb

package info (click to toggle)
ruby-ffi-rzmq 2.0.1-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 380 kB
  • ctags: 204
  • sloc: ruby: 2,945; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 709 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
require File.join(File.dirname(__FILE__), %w[spec_helper])

module ZMQ
  describe Util do

    if LibZMQ.version4?
      describe "curve_keypair" do

        xit "returns a set of public and private keys" do
          public_key, private_key = ZMQ::Util.curve_keypair

          public_key.should_not == private_key
          public_key.should_not be_nil
          private_key.should_not be_nil
        end

        it "raises if zmq does not support CURVE (libsodium not linked)" do
          lambda {
            LibZMQ.should_receive(:zmq_curve_keypair).and_return(-1)
            ZMQ::Util.curve_keypair
          }.should raise_exception(ZMQ::NotSupportedError)
        end

      end
    end

  end
end