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

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

when("I add them", function(context) {
  context$result <- sum(context$numbers)
})

when("I do nothing more", function(context) {

})

then("I get {int}", function(int, context) {
  expect_equal(context$result, int)
})

then("it's over", function(context) {

})

Try the cucumber package in your browser

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

cucumber documentation built on June 30, 2024, 1:07 a.m.