mirror of
https://github.com/we-promise/sure.git
synced 2026-05-24 21:14:56 +00:00
* feat(exports): add rule operand references * fix(exports): preserve rule operand references * refactor(exports): simplify rule operand branches * refactor(validation): centralize UUID format checks * fix(imports): preserve false rule operands
18 lines
453 B
Ruby
18 lines
453 B
Ruby
require "test_helper"
|
|
|
|
class UuidFormatTest < ActiveSupport::TestCase
|
|
test "valid matches canonical UUID values" do
|
|
uuid = SecureRandom.uuid
|
|
|
|
assert UuidFormat.valid?(uuid)
|
|
assert UuidFormat.valid?(uuid.upcase)
|
|
end
|
|
|
|
test "valid rejects non UUID values" do
|
|
refute UuidFormat.valid?(nil)
|
|
refute UuidFormat.valid?("")
|
|
refute UuidFormat.valid?("not-a-uuid")
|
|
refute UuidFormat.valid?("#{SecureRandom.uuid}-extra")
|
|
end
|
|
end
|