From 627e59de5c78f99aa1ef3abeacfe0a5d8604ff2e Mon Sep 17 00:00:00 2001 From: sacOO7 Date: Mon, 29 Apr 2024 17:28:57 +0530 Subject: [PATCH] Removed code duplication from ruby encrypt and decrypt string --- spec/unit/util/crypto_spec.rb | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/spec/unit/util/crypto_spec.rb b/spec/unit/util/crypto_spec.rb index bd93b9da1..1cd77e96a 100644 --- a/spec/unit/util/crypto_spec.rb +++ b/spec/unit/util/crypto_spec.rb @@ -74,17 +74,12 @@ context 'encrypts & decrypt' do let(:string) { random_str } - let(:byte_array) { random_str.to_msgpack.unpack('C*') } - specify '#encrypt encrypts a string' do + specify '#encrypts and decrypts a string' do encrypted = subject.encrypt(string) expect(subject.decrypt(encrypted)).to eql(string) end - specify '#decrypt decrypts a string' do - encrypted = subject.encrypt(string) - expect(subject.decrypt(encrypted)).to eql(string) - end end context 'encrypting an empty string' do