-
Notifications
You must be signed in to change notification settings - Fork 339
Incorporate doc feedback from @maelle #2231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Claude finished @hadley's task —— View job Code Review CompleteReviewing PR changes for potential bugs or issues:
Issues found:
LGTM for all other changes - documentation improvements, vignette references to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
}) | ||
``` | ||
|
||
If you don't care about reproducing the output of `continue()` and just want to recreate its return value, you can use `mock_output_sequence()`. This creates a function that each time it's called returns the next input supplied to `mock_output_sequence()`. The following code shows how it works and how you might use it to test `readline()`: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find the second sentence unclear.
If you don't care about reproducing the output of `continue()` and just want to recreate its return value, you can use `mock_output_sequence()`. This creates a function that each time it's called returns the next input supplied to `mock_output_sequence()`. The following code shows how it works and how you might use it to test `readline()`: | |
If you don't care about reproducing the output of `continue()` and just want to recreate its return value, you can use `mock_output_sequence()`. This creates a function that returns the input supplied to `mock_output_sequence()` in sequence: the first input at the first call, the second input at the second call, etc. The following code shows how it works and how you might use it to test `readline()`: |
|
||
## Do you need it? | ||
|
||
But before you read the rest of the vignette and dive into the full details of creating a fully 100% correct expectation, consider if you can get away with a simpler wrapper. For example, take this expectation from tidytext: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not start with an example of a wrapper that is fine? For instance it could be
expect_df <- function(tbl) {
expect_s3_class(tbl, "data.frame")
}
Or here is a real example: https://github.com/ropensci/aorsf/blob/2b7fa72bff5cd4e8b2984358e35d0938e50540b0/tests/testthat/helper-orsf.R#L259
|
||
## Do you need it? | ||
|
||
But before you read the rest of the vignette and dive into the full details of creating a fully 100% correct expectation, consider if you can get away with a simpler wrapper. For example, take this expectation from tidytext: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But before you read the rest of the vignette and dive into the full details of creating a fully 100% correct expectation, consider if you can get away with a simpler wrapper. For example, take this expectation from tidytext: | |
But before you read the rest of the vignette and dive into the full details of creating a 100% correct expectation, consider if you can get away with a simpler wrapper. For example, take this expectation from tidytext: |
No description provided.