Running ‘testthat.R’ [3s/4s]
Running the tests in ‘tests/testthat.R’ failed.
Complete output:
  > library(testthat)
  > library(githubinstall)
  > 
  > test_check("githubinstall",  filter = "[^(really_install)]")
  ── 1. Error: Install: ask no (@test-gh_install_packages.R#27)  ─────────────────
  Can't mock functions in base packages (base)
  1: with_mock(`base::readline` = function(...) "No", expect_error(gh_install_packages(repo, 
         ask = TRUE))) at testthat/test-gh_install_packages.R:27
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 2. Error: Install: ask yes (@test-gh_install_packages.R#37)  ────────────────
  Can't mock functions in base packages (base)
  1: with_mock(`base::readline` = function(...) "Y", `githubinstall:::install_package` = install_package_mock, 
         act <- gh_install_packages(repo, ask = TRUE)) at testthat/test-gh_install_packages.R:37
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 3. Error: recommend_dependencies: ask = TRUE (@test-utils_for_install.R#49)  
  Can't mock functions in base packages (base)
  1: with_mock(`base::readline` = function(...) {
         is_passed_mock <<- TRUE
         "y"
     }, act <- recommend_dependencies(ask = ask, build_vignettes = build_vignettes, dependencies = dependencies, 
         quiet = quiet)) at testthat/test-utils_for_install.R:49
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 4. Error: select_repository: multi candidates (@test-utils_for_install.R#130)
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::menu` = function(...) 1, act <- select_repository(package_name = package_name)) at testthat/test-utils_for_install.R:130
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 5. Error: select_repository: cancel (@test-utils_for_install.R#142)  ────────
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::menu` = function(...) 0, expect_error(select_repository(package_name = package_name))) at testthat/test-utils_for_install.R:142
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 6. Error: remove_conflict_repos: no installed (@test-utils_for_install.R#169)
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) NA, act <- remove_conflict_repos(repos = repos, 
         lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:169
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 7. Error: remove_conflict_repos: not conflict (@test-utils_for_install.R#183)
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, GithubRepo = pkg, 
         GithubUsername = "johndoe"), `base::readline` = stop, act <- remove_conflict_repos(repos = repos, 
         lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:183
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 8. Error: remove_conflict_repos: conflict GitHub, ask yes (@test-utils_for_in
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, GithubRepo = pkg, 
         GithubUsername = "ANOther"), `base::readline` = function(...) "y", act <- remove_conflict_repos(repos = repos, 
         lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:198
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 9. Error: remove_conflict_repos: conflict GitHub, ask no (@test-utils_for_ins
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, GithubRepo = pkg, 
         GithubUsername = "ANOther"), `base::readline` = function(...) "n", act <- remove_conflict_repos(repos = repos, 
         lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:213
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 10. Error: remove_conflict_repos: conflict CRAN, ask yes (@test-utils_for_ins
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, Repository = "CRAN"), 
         `base::readline` = function(...) "y", act <- remove_conflict_repos(repos = repos, 
             lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:228
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 11. Error: remove_conflict_repos: conflict CRAN, ask no (@test-utils_for_inst
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, Repository = "CRAN"), 
         `base::readline` = function(...) "n", act <- remove_conflict_repos(repos = repos, 
             lib = lib, quiet = quiet, ask = ask)) at testthat/test-utils_for_install.R:243
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ── 12. Error: remove_conflict_repos: conflict, ask == FALSE (@test-utils_for_ins
  Can't mock functions in base packages (utils)
  1: with_mock(`utils::packageDescription` = function(pkg, ...) list(Package = pkg, Repository = "CRAN"), 
         `base::readline` = stop, expect_message(remove_conflict_repos(repos = repos, 
             lib = lib, quiet = quiet, ask = ask))) at testthat/test-utils_for_install.R:258
  2: extract_mocks(new_values = new_values[!code_pos], .env = .env, eval_env = parent.frame())
  3: lapply(stats::setNames(nm = mock_qual_names), function(qual_name) {
         pkg_name <- gsub(pkg_and_name_rx, "\\1", qual_name)
         if (is_base_pkg(pkg_name)) {
             stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
         }
         name <- gsub(pkg_and_name_rx, "\\2", qual_name)
         if (pkg_name == "") 
             pkg_name <- .env
         env <- asNamespace(pkg_name)
         if (!exists(name, envir = env, mode = "function")) 
             stop("Function ", name, " not found in environment ", environmentName(env), 
                 ".", call. = FALSE)
         mock(name = name, env = env, new = eval(new_values[[qual_name]], eval_env, eval_env))
     })
  4: FUN(X[[i]], ...)
  5: stop("Can't mock functions in base packages (", pkg_name, ")", call. = FALSE)
  
  ══ testthat results  ═══════════════════════════════════════════════════════════
  OK: 34 SKIPPED: 0 FAILED: 12
  1. Error: Install: ask no (@test-gh_install_packages.R#27) 
  2. Error: Install: ask yes (@test-gh_install_packages.R#37) 
  3. Error: recommend_dependencies: ask = TRUE (@test-utils_for_install.R#49) 
  4. Error: select_repository: multi candidates (@test-utils_for_install.R#130) 
  5. Error: select_repository: cancel (@test-utils_for_install.R#142) 
  6. Error: remove_conflict_repos: no installed (@test-utils_for_install.R#169) 
  7. Error: remove_conflict_repos: not conflict (@test-utils_for_install.R#183) 
  8. Error: remove_conflict_repos: conflict GitHub, ask yes (@test-utils_for_install.R#198) 
  9. Error: remove_conflict_repos: conflict GitHub, ask no (@test-utils_for_install.R#213) 
  1. ...
  
  Error: testthat unit tests failed
  Execution halted