You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there,
I have some methods that return a certain error code with quit(status = error_code) and I would like to test that these methods return exactly the expected codes.
When running such a method inside a testthat test, the R terminal quits.
Is there an expect-method to test that a method returns a certain exit code?
I'd strongly recommend against calling quit() in a function since this is rather hostile to your user. If you really do want to do this, then you could use local_mocked_binding() to temporarily make quit() do something other than quitting.
Hi there,
I have some methods that return a certain error code with
quit(status = error_code)
and I would like to test that these methods return exactly the expected codes.When running such a method inside a testthat test, the R terminal quits.
Is there an expect-method to test that a method returns a certain exit code?
Example:
To be tested method
bar
in file foo.RDesired Test:
The text was updated successfully, but these errors were encountered: