Skip to content

Commit

Permalink
uuid_v7
Browse files Browse the repository at this point in the history
  • Loading branch information
dpep committed Nov 23, 2023
1 parent 942840d commit 5e4eb50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ GEM
simplecov_json_formatter (0.1.4)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
uuid7 (0.2.0)
zeitwerk (~> 2.4)
zeitwerk (2.6.12)

PLATFORMS
ruby
Expand All @@ -65,6 +68,7 @@ DEPENDENCIES
rspec
rspec-uuid!
simplecov
uuid7

BUNDLED WITH
2.4.6
2.4.20
1 change: 1 addition & 0 deletions rspec-uuid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ Gem::Specification.new do |s|
s.add_development_dependency "faker"
s.add_development_dependency "rspec"
s.add_development_dependency "simplecov"
s.add_development_dependency "uuid7"
end
2 changes: 2 additions & 0 deletions spec/matchers_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,15 @@
let(:uuid_v3) { Digest::UUID.uuid_v3(namespace, "123") }
let(:uuid_v4) { SecureRandom.uuid }
let(:uuid_v5) { Digest::UUID.uuid_v5(namespace, "123") }
let(:uuid_v7) { UUID7.generate }

specify { expect(uuid_v3).to be_a_uuid(version: 3) }
specify { expect(uuid_v3).not_to be_a_uuid(version: 4) }
specify { expect(uuid_v3).not_to be_a_uuid(version: 5) }

specify { expect(uuid_v4).to be_a_uuid(version: 4) }
specify { expect(uuid_v5).to be_a_uuid(version: 5) }
specify { expect(uuid_v7).to be_a_uuid(version: 7) }

it "fails with a useful message" do
expect {
Expand Down
1 change: 1 addition & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require "rspec"
require "rspec/matchers/fail_matchers"
require "simplecov"
require "uuid7"

SimpleCov.start do
add_filter "spec/"
Expand Down

0 comments on commit 5e4eb50

Please sign in to comment.