Sha256: a6bf2c58ed44b77797f4f0604a0a645d6400951a38335f2843823a25e8c069a0

Contents?: true

Size: 567 Bytes

Versions: 10

Compression:

Stored size: 567 Bytes

Contents

# encoding: binary
# frozen_string_literal: true

RSpec.describe RbNaCl::SecretBox do
  let(:key) { vector :secret_key }

  context "new" do
    it "accepts strings" do
      expect { RbNaCl::SecretBox.new(key) }.to_not raise_error
    end

    it "raises on a nil key" do
      expect { RbNaCl::SecretBox.new(nil) }.to raise_error(TypeError)
    end

    it "raises on a short key" do
      expect { RbNaCl::SecretBox.new("hello") }.to raise_error RbNaCl::LengthError
    end
  end

  include_examples "box" do
    let(:box) { RbNaCl::SecretBox.new(key) }
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rbnacl-7.1.1 spec/rbnacl/secret_box_spec.rb
rbnacl-7.1.0 spec/rbnacl/secret_box_spec.rb
rbnacl-7.0.0 spec/rbnacl/secret_box_spec.rb
rbnacl-6.0.1 spec/rbnacl/secret_box_spec.rb
rbnacl-6.0.0 spec/rbnacl/secret_box_spec.rb
rbnacl-5.0.0 spec/rbnacl/secret_box_spec.rb
rbnacl-4.0.2 spec/rbnacl/secret_box_spec.rb
rbnacl-4.0.1 spec/rbnacl/secret_box_spec.rb
rbnacl-4.0.0 spec/rbnacl/secret_box_spec.rb
rbnacl-4.0.0.pre spec/rbnacl/secret_box_spec.rb