Sha256: 57b60621289b7f1d384a238a00c55b88e916ac042fc744a76399c6ce5f328dea

Contents?: true

Size: 462 Bytes

Versions: 1

Compression:

Stored size: 462 Bytes

Contents

require "test_helper"

class MarshalTest < Minitest::Test
  let(:key) { "my secret key" }

  test "encrypts data" do
    refute_equal Marshal.dump("hello"), Parsel::Marshal.encrypt(key, "hello")
  end

  test "decrypts data" do
    encrypted = Parsel::Marshal.encrypt(key, "hello")
    assert_equal "hello", Parsel::Marshal.decrypt(key, encrypted)
  end

  test "returns false when decryption fails" do
    refute Parsel::Marshal.decrypt("abc", "123")
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
parsel-1.0.0 test/parsel/marshal_test.rb