expect_neet: Test for non-empty thing of expected type

Description Usage Arguments See Also

View source: R/expect_neet.R

Description

Test for non-empty thing of expected type

Usage

1
expect_neet(thing_to_test, expected_class)

Arguments

thing_to_test

An object to test, such as a numeric, character, list, etc.

expected_class

Expected output of class(thing_to_test).

A neet test tests for non-empty thing of expected type. This is what is referred to as a boundary condition test in RStudio's primers (todo: citation).

These expectations are intended to integrate into minimal testing workflow for development of data analyses. When developing a function, we will change parameters, and structure of the pipeline. These tests enable the developer to feel reassured the pipeline's functions are outputting non-empty thing of expected type, while the developer decides on the best structure for an analysis pipeline.

A character string will be checked for being of string-length > 1.

A numeric is checked for being non-empty.

A numint is checked for being numeric or integer.

An integer is checked for being of length > 1.

A 'list“ is checked for being of length > 1.

A data.frame is checked for having at least one row.

A ggplot object is checked for successfully running.

assert_neet tests the input is non-empty and of expected type, and expect_neet is an expectation for test_that that checks the output is non-empty and of expected type test_neet is a test for testthat

See Also

Other neet Test for non-empty thing of expected type.: assert_neet(), test_neet()


softloud/neet documentation built on May 31, 2020, 12:40 a.m.