unitizer (version 1.4.2)

$.unitizerItem: Retrieve Test Contents From Test Item

Description

Intended for use within the unitizer interactive environment, allows user to retrieve whatever portions of tests are stored by unitizer.

Usage

# S4 method for unitizerItem
$(x, name)

# S4 method for unitizerItem,ANY [[(x, i, j, ..., exact = TRUE)

Arguments

x

a unitizerItem object, typically .NEW or .REF at the unitizer interactive prompt

name

a valid test sub-component

i

a valid test sub-component as a character string, or a sub-component index

j

missing for compatibility with generic

...

missing for compatibility with generic

exact

unused, always matches exact

Value

the test component requested

Details

Currently the following elements are available:

  • call the call that was tested as an unevaluated call, but keep in mind that if you intend to evaluate this for a reference item the environment may not be the same so you could get different results (ls will provide more details)

  • value the value that results from evaluating the test, note this is equivalent to using .new or .ref; note that the value is displayed using desc when viewing all of .NEW or .REF

  • output the screen output (i.e. anything produced by cat/print, or any visible evaluation output) as a character vector

  • message anything that was output to stderr, mostly this is all contained in the conditions as well, though there could be other output here, as a character vector

  • conditions a conditionList containing all the conditions produced during test evaluation

  • aborted whether the test call issues a restart call to the `abort` restart, as `stop` does.

Examples

Run this code
## From the unitizer> prompt:
.NEW <- mock_item()  # .NEW is normally available at unitizer prompt
.NEW$call
.NEW$conditions
.NEW$value              # equivalent to `.new`

Run the code above in your browser using DataCamp Workspace