-
Notifications
You must be signed in to change notification settings - Fork 18
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
Fix/compliance #61
Conversation
|
||
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)) |
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.
Please use expect_gt() and avoid using info (will be deprecated).
Could you please merge/rebase with master so that the tests can run? |
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)) |
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.
Do you need #' @importFrom methods getClass getClasses
? Then it might work even without library(methods)
, which I'd prefer.
Indeed, I missed that. Added getClass and extends to importFrom. |
Thanks! |
- 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`.
- 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.
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.