inst/examples/long_scenario/tests/acceptance/setup-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 8, 2025, 12:47 p.m.