Skip to content

Conversation

MichaelChirico
Copy link
Contributor

It would be simpler to add the skip() inside the helper:

with_mock <- function(..., .parent = parent.frame()) {
mockr::with_mock(..., .parent = .parent, .env = "googledrive")
}

But the tests would have to be rewritten a bit, e.g.

with_mock(
root_id = function() "",
{
out <- resolve_paths(as_dribble(x), ancestors)
}
)
expect_equal(out$path, "e")

Would probably become:

with_mock(
  root_id = function() "",
  expect_equal(resolve_paths(as_dribble(x), ancestors)$path, "e")
)

That format of test looks more natural to me anyway, but filing as is now pending feedback.

@jennybc
Copy link
Member

jennybc commented Jun 27, 2023

I've been removing mockr dependencies in favor of testthat::local_mocked_bindings(). Apparently I just haven't done so here yet. So I'm not going to take a change that touches this stuff in any other way; it's not worth fiddling with it.

@MichaelChirico
Copy link
Contributor Author

Makes sense! I'll leave this open for now in case it serves as a reminder, but feel free to close at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants