Module: Validity

Included in:
Record
Defined in:
lib/validity.rb,
lib/validity/record.rb,
lib/validity/frameworks/test_unit/record.rb

Defined Under Namespace

Modules: TestUnit Classes: Record, Unconfigured, Unsupported

Class Method Summary collapse

Class Method Details

.configure(test_framework) ⇒ Object

Configures Validity to use the provided test_framework.

  • Args:

    • test_framework the framework to use for testing

  • Returns:

    • the test framework Validity was configured to use

  • Raises:

    • Unsupported if the provided test framework is unsupported

Raises:



25
26
27
28
# File 'lib/validity.rb', line 25

def self.configure(test_framework)
  raise Unsupported.new(test_framework) if !supported?(test_framework)
  @@test_framework = test_framework
end

.configured?Boolean

Returns whether or not Validity is configured.

  • Returns:

    • whether or not Validity has been configured

Returns:

  • (Boolean)


34
35
36
# File 'lib/validity.rb', line 34

def self.configured?
  !@@test_framework.nil?
end

.reset!Object

Resets Validity to an unconfigured state.



39
40
41
# File 'lib/validity.rb', line 39

def self.reset!
  @@test_framework = nil
end

.supportedObject

Returns a list of test frameworks Validity supports.

  • Returns:

    • a list of test frameworks Validity supports



47
48
49
# File 'lib/validity.rb', line 47

def self.supported
  SUPPORTED
end