Sha256: ec2cb732a063d91c626e78c8a46147984118fb3cd9ee6278faac16f35c58934e

Contents?: true

Size: 952 Bytes

Versions: 6

Compression:

Stored size: 952 Bytes

Contents

include Cifrado::Utils

Shindo.tests('Cifrado | Utils') do

  tests 'clean_object_name' do
    test './foo/bar/stuff' do
      clean_object_name('./foo/bar/stuff') == 'foo/bar/stuff'
    end
    test '//foo/bar/stuff' do
      clean_object_name('//foo/bar/stuff') == 'foo/bar/stuff'
    end
    test '/foo/bar/stuff' do
      clean_object_name('/foo/bar/stuff') == 'foo/bar/stuff'
    end
    test 'foo/bar/stuff' do
      clean_object_name('foo/bar/stuff') == 'foo/bar/stuff'
    end
  end

  test 'encrypt_filename' do
    cs = CryptoEngineAES.new passphrase
    filename = "/tmp/cifrado-payload-foobaro8u2ojf98"
    n = cs.encrypt filename
    cs.decrypt(n) == filename and n.lines.count == 1
  end

  test 'decrypt_filename' do
    cs = CryptoEngineAES.new passphrase
    fname = 'U2FsdGVkX19Wm6CdV6LF7j7wATQjH02-jeOJTy-Rt_Qs4WCDRblLWvHkvadbuZV9OKn0Rc5_X4BOwspPSV6ZBA=='
    cs.decrypt(fname) == "/tmp/cifrado-payload-foobaro8u2ojf98"
  end
  
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cifrado-0.2.1 tests/utils_tests.rb
cifrado-0.2.0 tests/utils_tests.rb
cifrado-0.1.3 tests/utils_tests.rb
cifrado-0.1.2 tests/utils_tests.rb
cifrado-0.1.1 tests/utils_tests.rb
cifrado-0.1 tests/utils_tests.rb