Module: Verity::Registry

Defined in:
lib/verity.rb

Overview

Internal: Global test registry. Tests are appended during file loading and queried at run time by the Runner and manifest.

Class Method Summary collapse

Class Method Details

.allObject

Internal: Return a shallow copy of all registered tests.

Returns an Array of Verity::Test.



297
# File 'lib/verity.rb', line 297

def self.all = @tests.dup

.clearObject

Internal: Remove every registered test. Used before re-loading files.

Returns an empty Array.



302
# File 'lib/verity.rb', line 302

def self.clear = @tests.clear

.find(fingerprint) ⇒ Object

Internal: Look up a test by its fingerprint string.

fingerprint - String fingerprint to match.

Returns a Verity::Test or nil.



309
# File 'lib/verity.rb', line 309

def self.find(fingerprint) = @tests.find { |t| t.fingerprint == fingerprint }

.register(test) ⇒ Object

Internal: Add a test to the global registry.

test - A Verity::Test instance.

Returns the updated Array.



292
# File 'lib/verity.rb', line 292

def self.register(test) = @tests << test