Sha256: ee606d95c11c2ec85dbac8a96c3bb063f5ddf0123bf8d3678388623b95976178

Contents?: true

Size: 514 Bytes

Versions: 11

Compression:

Stored size: 514 Bytes

Contents

require 'spec_helper'

RSpec.describe ComplexConfig::Encryption do
  let :secret do
    "\x1A8\x9E\xA8\xC2\x7F@@6\xB2W\a\x9A)\xCDw"
  end

  let :value do
    Marshal.dump('foobar')
  end

  let :enc do
    described_class.new secret
  end

  let :encrypted do
    "3uAULzmKjJGIWuFeEK+fORPAMPs=--BhH9oIkxoDiOlyLK--Ni5r+QtO9EYcDd7HlYd3Yw=="
  end

  it 'can encrypt' do
    expect(enc.encrypt(value)).to match /\A.+--.+--.+==\z/
  end

  it 'can decrypt' do
    expect(enc.decrypt(encrypted)).to eq value
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
complex_config-0.14.0 spec/complex_config/encryption_spec.rb
complex_config-0.13.3 spec/complex_config/encryption_spec.rb
complex_config-0.13.2 spec/complex_config/encryption_spec.rb
complex_config-0.13.1 spec/complex_config/encryption_spec.rb
complex_config-0.13.0 spec/complex_config/encryption_spec.rb
complex_config-0.12.1 spec/complex_config/encryption_spec.rb
complex_config-0.12.0 spec/complex_config/encryption_spec.rb
complex_config-0.11.3 spec/complex_config/encryption_spec.rb
complex_config-0.11.2 spec/complex_config/encryption_spec.rb
complex_config-0.11.1 spec/complex_config/encryption_spec.rb
complex_config-0.11.0 spec/complex_config/encryption_spec.rb