@@ -181,24 +181,27 @@ test_that("pkg_dep_status reports missing packages", {
181181 expect_true(is.na(result $ installed [[2 ]]))
182182})
183183
184- test_that(" pkg_dep_status works with a package object and filters self" , {
184+ test_that(" pkg_dep_status filters out self" , {
185185 pkg_path <- local_package_create()
186186 pkg_obj <- as.package(pkg_path )
187+ pkg_name <- pkg_obj $ package
188+
189+ deps <- data.frame (
190+ package = c(pkg_name , " rlang" ),
191+ version = c(" 0.0.1" , " 99999.0.0" )
192+ )
187193
188194 local_mocked_bindings(
189- local_dev_deps = function (... ) {
190- data.frame (
191- # the package itself typically appears as first row and we want to
192- # confirm it gets filtered out
193- package = c(pkg_obj $ package , " rlang" ),
194- version = c(" 0.0.1" , " 99999.0.0" )
195- )
196- },
195+ local_dev_deps = function (... ) deps ,
196+ pkg_deps = function (... ) deps ,
197197 .package = " pak"
198198 )
199199
200200 result <- pkg_dep_status(pkg_obj )
201- expect_false(pkg_obj $ package %in% result $ package )
201+ expect_false(pkg_name %in% result $ package )
202+
203+ result <- pkg_dep_status(pkg_name )
204+ expect_false(pkg_name %in% result $ package )
202205})
203206
204207test_that(" print shows RStudio update message" , {
0 commit comments