Initial commit

This commit is contained in:
Yaser
2026-08-13 19:50:53 +03:30
commit 38084458fe
879 changed files with 95198 additions and 0 deletions

22
spec/lib/uuid_spec.rb Normal file
View File

@@ -0,0 +1,22 @@
# encoding: UTF-8
# frozen_string_literal: true
describe UUID do
let(:uuid) { UUID.generate }
let(:invalid_uuid) { "bcfbd6f6-8c-4bcd-b76a-ed68a01347a5" }
let(:type) { UUID::Type.new }
let(:correct_uuid) { UUID.validate(uuid) }
let(:incorrect_uuid) { UUID.validate(invalid_uuid) }
it 'seizlizes and deserializes correctly' do
bytes = type.serialize(uuid)
expect(bytes.bytesize).to eq 16
expect(type.deserialize(bytes)).to eq uuid
end
it 'validates uuid correctly' do
expect(correct_uuid).to be_truthy
expect(incorrect_uuid).to be_falsy
end
end