Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
dpep committed Jun 9, 2022
1 parent 0a33dfd commit d560159
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rspec/uuid.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
require "rspec/expectations"

RSpec::Matchers.define :be_a_uuid do |version: nil|
chain :of_version do |version|
@version = version
end

match do |actual|
raise ArgumentError if @version && version

Expand All @@ -21,10 +25,6 @@
end
end

chain :of_version do |version|
@version = version
end

description do
version ? "a UUID v#{version}" : "a UUID"
end
Expand Down

0 comments on commit d560159

Please sign in to comment.