Skip to contents

Write a test feature.

Usage

feature(title, as_a, i_want, so_that)

Arguments

title

The feature title

as_a

"As a" <user/stakeholder>

i_want

"I want"

so_that

"So that"

Value

A feature (based on Gherkin syntax)

Technical details

The contents of feature are returned as a 'glue' chr, but retain Gherkin-style indentation. These can be passed to testthat's it() or test_that() testing functions.

See also

scenario()

Other "BDD helpers": background(), scenario()

Examples

feature(title = "Visualization",
        as_a = "user",
        i_want = "to see the changes in the plot",
        so_that = "I can visualize the impact of my customizations")
#> Feature: Visualization
#>   As a user
#>   I want to see the changes in the plot
#>   So that I can visualize the impact of my customizations