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
# use a function so user doesn't have to figure out the # incantation for the R6 objectcall_count<-function(stub) {
stub$counter$count()
}
# possibly use the last stub used by default? but would have to show# the stub then (`last_stub_used` doesn't exist yet)call_count<-function(stub= last_stub_used()) {
stub$counter$count()
}
# optionally just give back counts for all stubs if `stub` is `NULL`?# this uses cli so would have to add that dep, but it doesn't have deps itselfcall_count<-function(stub=NULL) {
reg<- stub_registry()
stubs<-reg$request_stubs
cli_alert_info(style_underline(style_bold("count --- stub")))
for (stubinstubs) {
cat(
symbol$info, "",
style_bold(stub$counter$count()), " --- ",
stub$to_s(), "\n",
sep=""
)
}
}
The text was updated successfully, but these errors were encountered:
seems quite easy with python's
pook
(mock.calls
), see first example block at https://github.com/h2non/pook?tab=readme-ov-file#examplesin this package, perhaps something like
The text was updated successfully, but these errors were encountered: