klutometis/roxygen — pull request #304 by Geoff99 (2014-11-16 00:30:16+00:00)
Title: Tests for update collate

This relates to pull request #303 which should resolve issue #302.

The change proposed in this pull request is the addition of a testthat in the roxygen2 test suite to check that `update_collate` actually does do nothing if no `@includes` are found (and in particular leaves any manually entered Collate field unaltered).

The test uses a template package called `testCollateNoInclude`, the key feature of which is that the DESCRIPTION file has a Collate field which was entered manually rather than generated by roxygen2 as a consequence of `@include` directives. The .r files in the R directory do **not** have any `@includes`.

The template package is copied into `tempdir()` before running the tests, since update_collate can have permanent side effects (viz generating a Collate field in the DESCRIPTION file). If `update_collate` was run on the template package itself, rather than on the copy in `tempdir()`, and the test failed, the template package would be altered, and future runs of the test would **not** be testing what the test is supposed to test.

I had intended to make this entirely separate from the fix mentioned in pull request #303 , but due to my *learner* level of competence with git this branch also includes the fix itself. If that is a problem, let me know and I will recreate it as an independent branch in the way I originally intended.

Feedback and guidance (re the pull request and/or my usage of git) most appreciated.

Geoff