Skip to content

Commit

Permalink
src_tbls() includes all tbls. (#4327)
Browse files Browse the repository at this point in the history
closes #4326
  • Loading branch information
romainfrancois committed May 6, 2019
1 parent c3b7df6 commit 9c6f59e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion R/src-local.r
Expand Up @@ -43,7 +43,7 @@ src_df <- function(pkg = NULL, env = NULL) {

#' @export
src_tbls.src_local <- function(x, ...) {
objs <- ls(envir = x$env)
objs <- ls(envir = x$env, all.names = TRUE)
Filter(function(obj) is.data.frame(get(obj, envir = x$env)), objs)
}

Expand Down
7 changes: 7 additions & 0 deletions tests/testthat/test-copy_to.R
Expand Up @@ -63,3 +63,10 @@ test_that("src_sqlite() errs if path does not exist", {
fixed = TRUE
)
})

test_that("src_tbls() includes all tbls (#4326)", {
expect_equal(
src_tbls(src_df(env = env(. = iris))),
"."
)
})

0 comments on commit 9c6f59e

Please sign in to comment.