Skip to content

Test() ​

Returns an instance of the class Test

idl
;+
; :Returns: test
;-
result = Test(luna_suite, description, $
  _ref_extra = value)

Init method for the IDL package test suite tests. Should only be called from a Suite object an not on it's own.

Examples ​

Create tests from a suite with suite.test, then create expectations from the test with test.expects. Each expectation checks one value:

idl
l = luna()
suite = l.suite('my_routine')

; create the test
it = suite.test('returns the sum of two numbers')

; add expectations - pass the value to check to expects()
(it.expects(my_routine(1, 2))).toEqual, 3
(it.expects(my_routine(1, 2)))._not_.toBeNull

Arguments ​

luna_suite ​

requiredinputtype=Suite

Specify the parent object.

description ​

requiredinputtype=String

Specify the string description for the suite of tests.

Keywords ​

_ref_extra {#kw-_ref_extra} ​

optionalinputtype=any

Specify the keywords VERBOSE, DEBUG, or QUIET on init and the corresponding object properties will be set and carry through to child objects.

Licensed under MIT.