From 9c6f59ee9142424d6111df195c664537b104ef8f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Romain=20Fran=C3=A7ois?= Date: Mon, 6 May 2019 09:24:04 +0200 Subject: [PATCH] src_tbls() includes all tbls. (#4327) closes #4326 --- R/src-local.r | 2 +- tests/testthat/test-copy_to.R | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/R/src-local.r b/R/src-local.r index 517101fc3d..3d90b3f6ed 100644 --- a/R/src-local.r +++ b/R/src-local.r @@ -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) } diff --git a/tests/testthat/test-copy_to.R b/tests/testthat/test-copy_to.R index 973f2e44da..8792c6fa03 100644 --- a/tests/testthat/test-copy_to.R +++ b/tests/testthat/test-copy_to.R @@ -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))), + "." + ) +})