Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ECO-4688] Fix tests #391

Merged
merged 25 commits into from
May 30, 2024
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8dea861
fixed failing test due to old simplecov dependency
sacOO7 Mar 7, 2024
171075e
Included CI support for ruby 3.2 and 3.3
sacOO7 Apr 22, 2024
e5df18b
Refactored author emails in the gemspec
sacOO7 Apr 22, 2024
f811abb
Updated ably-common git submodules
sacOO7 Apr 23, 2024
e5a8753
updated CI to update SSL certificates to fix openSSL errors
sacOO7 Apr 23, 2024
627e59d
Removed code duplication from ruby encrypt and decrypt string
sacOO7 Apr 29, 2024
218f120
Refactored empty string encryption/decryption test
sacOO7 Apr 29, 2024
a0a3b98
Fixed empty string encryption using openSSL crypto
sacOO7 Apr 29, 2024
46536b1
Added ably em http request as an explicit dependency
sacOO7 Apr 30, 2024
22ed1f3
Disabled bundler cache for ruby
sacOO7 Apr 30, 2024
d93df4f
added bundle install command for parallel_rspec
sacOO7 Apr 30, 2024
2ebc4aa
Revert "added bundle install command for parallel_rspec"
sacOO7 Apr 30, 2024
3d792ec
Fixed ably-em-http-request commit hash
sacOO7 Apr 30, 2024
bcfebff
Added clock skew for renewing token after it expires
sacOO7 May 1, 2024
f26dec9
Added clock skew for flaky unit test
sacOO7 May 1, 2024
754c158
refactored skew ruby constant to clock_skew instead
sacOO7 May 2, 2024
db1ffe9
updated fromSerial param and skipped related test
sacOO7 May 2, 2024
ff686cb
Refactored check.yml, removed unnecessary commands to install ca cert…
sacOO7 May 2, 2024
028a460
Merge branch 'feature/no-connection-serial' into fix/tests
sacOO7 May 16, 2024
505b9e8
Removed unnecessary line from a gemfile that points to a working branch
sacOO7 May 16, 2024
77aefef
fixed indentation/formatting for connection.rb file
sacOO7 May 29, 2024
25d39d3
updated crypto encrypt/decrypt test with proper naming convention
sacOO7 May 29, 2024
510f52d
updated connection spec clock skew as per review comment
sacOO7 May 29, 2024
da38d24
Reverted connection param fromSerial to original from_serial while fe…
sacOO7 May 29, 2024
bf16515
Added comment description for fixed timer related flaky test
sacOO7 May 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions spec/unit/util/crypto_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -74,20 +74,26 @@

context 'encrypts & decrypt' do
let(:string) { random_str }
let(:empty_string) { '' }

specify '#encrypts and decrypts a string' do
lawrence-forooghian marked this conversation as resolved.
Show resolved Hide resolved
expect(string).to be_ascii_only
lawrence-forooghian marked this conversation as resolved.
Show resolved Hide resolved
encrypted = subject.encrypt(string)
expect(subject.decrypt(encrypted)).to eql(string)
expect(encrypted).to be_truthy
decrypted = subject.decrypt(encrypted)
expect(decrypted).to eql(string)
expect(decrypted).to be_ascii_only
end

end

context 'encrypting an empty string' do
lawrence-forooghian marked this conversation as resolved.
Show resolved Hide resolved
let(:empty_string) { '' }

it 'raises an ArgumentError' do
expect { subject.encrypt(empty_string) }.to raise_error ArgumentError, /data must not be empty/
specify '#encrypts and decrypts an empty string' do
lawrence-forooghian marked this conversation as resolved.
Show resolved Hide resolved
expect(empty_string).to be_ascii_only
encrypted = subject.encrypt(empty_string)
expect(encrypted).to be_truthy
decrypted = subject.decrypt(encrypted)
expect(decrypted).to eql(empty_string)
expect(decrypted).to be_ascii_only
end

end

context 'using shared client lib fixture data' do
Expand Down
Loading