Skip to content

Fix/compliance #61

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

Merged
merged 5 commits into from
Mar 30, 2016
Merged

Fix/compliance #61

merged 5 commits into from
Mar 30, 2016

Conversation

hoesler
Copy link
Contributor

@hoesler hoesler commented Mar 8, 2016

This compliance check is more generic.

In my DBI implementation hoesler/dbj, I am creating two different Result classes, depending on the type of the query.
The modified compliance check takes care of this. For all three DBI classes, it searches for classes in the package that extend them. Then, it checks for their presence and their methods.


methods <- Map(function(g, c) test_has_methods(g, c, where),
key_methods, classes)
expect_more_than(length(classes), 0, info = paste0("No class in package ", pkg, " extends ", dbi_class))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use expect_gt() and avoid using info (will be deprecated).

@krlmlr
Copy link
Member

krlmlr commented Mar 10, 2016

Could you please merge/rebase with master so that the tests can run?

@hoesler
Copy link
Contributor Author

hoesler commented Mar 10, 2016

The build failed because the 'methods' package is not loaded. I think it should be added to the test call in the Makefile. I will try that.


classes <- Filter(function(class) {
extends(class, dbi_class) && getClass(class)@virtual == FALSE
}, getClasses(where))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you need #' @importFrom methods getClass getClasses? Then it might work even without library(methods), which I'd prefer.

@hoesler
Copy link
Contributor Author

hoesler commented Mar 10, 2016

Indeed, I missed that. Added getClass and extends to importFrom.

@krlmlr krlmlr merged commit fff5745 into r-dbi:master Mar 30, 2016
@krlmlr
Copy link
Member

krlmlr commented Mar 30, 2016

Thanks!

krlmlr pushed a commit that referenced this pull request May 21, 2016
- Update documentation to reflect test condition (#70, @imanuelcostigan).
- Support names for contexts (#67, @hoesler).
- `simultaneous_connections` test always closes all connections on exit (@hoesler, #68).
- More generic compliance check (@hoesler, #61).
- Use container-based builds on Travis.
- Install `RPostgres` and `RMySQL` from `rstats-db`.
krlmlr pushed a commit that referenced this pull request May 24, 2016
- Infrastructure
    - Support names for contexts (@hoesler, #67).
    - The `skip` argument to the test functions is now treated as a Perl regular expression to allow negative lookahead. Use `skip = "(?!test_regex).*"` to choose a single test to run (#33).
    - Added encoding arguments to non-ASCII string constants (#60, @hoesler).
- Improve tests
    - `simultaneous_connections` test always closes all connections on exit (@hoesler, #68).
    - More generic compliance check (@hoesler, #61).
    - Update documentation to reflect test condition (@imanuelcostigan, #70).
- `testthat` dependency
    - Import all of `testthat` to avoid `R CMD check` warnings.
    - Compatibility with dev version of `testthat` (#62).
- Improve Travis builds
    - Use container-based builds on Travis.
    - Install `RPostgres` and `RMySQL` from `rstats-db`.
    - Install `DBI` and `testthat` from GitHub.
@github-actions github-actions bot locked and limited conversation to collaborators Dec 5, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants