inst/examples/covr_support/tests/testthat/steps/steps.R

given("I have the number {int}", function(number, context) {
  context$numbers <- c(context$numbers, number)
})

when("I compare the numbers", function(context) {
  context$result <- get_bigger(context$numbers[1], context$numbers[2])
})

then("the result should be {int}", function(expected, context) {
  expect_equal(context$result, expected)
})

Try the cucumber package in your browser

Any scripts or data that you put into this service are public.

cucumber documentation built on Oct. 14, 2024, 9:10 a.m.