This is the only test for reset_robot
:
test_that("Can reset the name", {
robot <- new_robot()
reset_robot <- reset_robot(robot)
expect_true(robot$name != reset_robot$name)
})
It seems to create a new robot. Whether the original robot’s name gets changed doesn’t seem to be tested for, only that it is different from the name of the new robot. I would think a test for reset_robot
as described in instructions would be something like:
test_that("Can reset the name", {
robot <- new_robot()
orig_name <- robot$name
reset_robot(robot)
expect_true(robot$name != orig_name)
})