Skip to content

Commit

Permalink
Removed code duplication from ruby encrypt and decrypt string
Browse files Browse the repository at this point in the history
  • Loading branch information
sacOO7 committed Apr 29, 2024
1 parent e5a8753 commit 627e59d
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions spec/unit/util/crypto_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 627e59d

Please sign in to comment.