Skip to content

Commit

Permalink
spec_meta_bind_formals
Browse files Browse the repository at this point in the history
  • Loading branch information
krlmlr authored and aviator-bot committed Dec 17, 2023
1 parent 9c33f9f commit 5b6cfe2
Show file tree
Hide file tree
Showing 6 changed files with 41 additions and 14 deletions.
1 change: 1 addition & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ Collate:
'spec-sql-remove-table.R'
'spec-sql-list-objects.R'
'spec-meta-bind-runner.R'
'spec-meta-bind-formals.R'
'spec-meta-bind.R'
'spec-meta-bind-.R'
'spec-meta-is-valid.R'
Expand Down
1 change: 1 addition & 0 deletions R/spec-.R
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#' @include spec-meta-is-valid.R
#' @include spec-meta-bind-.R
#' @include spec-meta-bind.R
#' @include spec-meta-bind-formals.R
#' @include spec-meta-bind-runner.R
#' @include spec-sql-list-objects.R
#' @include spec-sql-remove-table.R
Expand Down
22 changes: 22 additions & 0 deletions R/spec-meta-bind-formals.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#' spec_meta_bind
#' @name spec_meta_bind
#' @family meta specifications
#' @aliases NULL
#' @usage NULL
#' @format NULL
#' @keywords NULL
spec_meta_bind_formals <- list(
bind_formals = function() {
# <establish formals of described functions>
expect_equal(names(formals(dbBind)), c("res", "params", "..."))
},
#'
bind_empty = function(con) {
#' @section Failure modes:
#' Calling `dbBind()` for a query without parameters
res <- local_result(dbSendQuery(con, trivial_query()))
#' raises an error.
expect_error(dbBind(res, list()))
},
NULL
)
14 changes: 1 addition & 13 deletions R/spec-meta-bind.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,6 @@
#' @format NULL
#' @keywords NULL
spec_meta_bind <- list(
bind_formals = function() {
# <establish formals of described functions>
expect_equal(names(formals(dbBind)), c("res", "params", "..."))
},
#
bind_return_value = function(ctx, con) {
#' @return
check_return_value <- function(bind_res, res) {
Expand Down Expand Up @@ -43,16 +38,9 @@ spec_meta_bind <- list(
query = FALSE
)
},
#'
bind_empty = function(con) {
#' @section Failure modes:
#' Calling `dbBind()` for a query without parameters
res <- local_result(dbSendQuery(con, trivial_query()))
#' raises an error.
expect_error(dbBind(res, list()))
},
#
bind_too_many = function(ctx, con) {
#' @section Failure modes:
patch_bind_values <- function(bind_values) {
#' Binding too many
if (is.null(names(bind_values))) {
Expand Down
1 change: 1 addition & 0 deletions R/spec-meta.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#' @format NULL
spec_meta <- c(
spec_meta_bind_formals,
spec_meta_bind,
spec_meta_is_valid,
spec_meta_has_completed,
Expand Down
16 changes: 15 additions & 1 deletion man/spec_meta_bind.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5b6cfe2

Please sign in to comment.