Skip to content
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

add reusable examples #11

Closed
wants to merge 9 commits into from
Closed

add reusable examples #11

wants to merge 9 commits into from

Conversation

maxheld83
Copy link
Contributor

No description provided.

@maxheld83
Copy link
Contributor Author

I've built this out somewhat, still missing:

  • that it also works on "normal" @examples (no reason it shouldn't just takes the last return)
  • passing on @reusableExamples to @examples for all other treatment
  • renaming @resuableExamples to @namedExamples which would be more appropriate.

@maxheld83
Copy link
Contributor Author

‼️ but, more importantly, this is very likely a dead end 😔.

  • you can't rely on roxygen2 comments when the package is R CMD checked, or tests are otherwise run against an installed version.
    Disallowing this / skipping (via testthat::is_checking()) would fundamentally break how tests are supposed to work.
  • The path weirdness is already showing; not sure you can reliably identify the package source path from all contexts in which a test is run.
    And again, this whole thing needs the roxygen2 source to be available.
  • We could write out the example calls to a separate file (just like *.Rd files get rendered), but that's just more complexity and versioning hell.
  • Also, the UX is a bit awkward already.
    I think a more natural place to create the objects to be tested is inside the testthat/ folder.
  • the awkwardness already shows in dealing with p

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.

1 participant