Sha256: 94897edfc219e6d53726f13ec889344e8aaa60d8c7129db0b8303929cd8e40d1

Contents?: true

Size: 1.09 KB

Versions: 1

Compression:

Stored size: 1.09 KB

Contents

require_relative '../spec_helper'
require_relative '../../lib/rapid-vaults/api'

describe RapidVaults::API do
  context '.parse' do
    it 'correctly parses the settings for encrypt' do
      expect(RapidVaults::API.parse(action: :encrypt, file: 'file.txt', key: 'key.txt', nonce: 'nonce.txt', pw: 'secret')).to eq(algorithm: :openssl, ui: :api, action: :encrypt, file: 'file.txt', key: 'key.txt', nonce: 'nonce.txt', pw: 'secret')
    end
    it 'correctly parses the settings for decrypt' do
      expect(RapidVaults::API.parse(action: :decrypt, file: 'file.txt', key: 'key.txt', nonce: 'nonce.txt', tag: 'tag.txt', pw: 'secret')).to eq(algorithm: :openssl, ui: :api, action: :decrypt, file: 'file.txt', key: 'key.txt', nonce: 'nonce.txt', tag: 'tag.txt', pw: 'secret')
    end
    it 'correctly parses the settings for generate' do
      expect(RapidVaults::API.parse(action: :generate)).to eq(algorithm: :openssl, ui: :api, action: :generate)
    end
    it 'correctly overrides the algorithm setting' do
      expect(RapidVaults::API.parse(algorithm: :gpgme)).to eq(algorithm: :gpgme, ui: :api)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rapid-vaults-1.1.0 spec/rapid-vaults/api_spec.rb