@@ -21,19 +21,13 @@ test_that("can install in isolated repos", {
21
21
22
22
test_that(" cache works" , {
23
23
ref <- " devel"
24
- withr :: local_options(list (
25
- " touchstone.hash_source_package" = tibble :: tibble(
26
- ref = character (), md5_hashes = list (), path_pkg = character ()
27
- )
28
- ))
29
24
name_tmp_pkg <- " bli44"
30
25
path_pkg <- local_package(name_tmp_pkg , r_sample = " x <- 55" )
31
26
32
27
expect_equal(nrow(cache_get()), 0 )
33
28
expect_false(cache_up_to_date(ref , path_pkg ))
34
29
cache_update(ref , path_pkg )
35
30
expect_equal(nrow(cache_get()), 1 )
36
- print(getwd())
37
31
writeLines(c(" x <- 55" ), " R/sample.R" )
38
32
expect_true(cache_up_to_date(ref , path_pkg ))
39
33
writeLines(c(" 22" ), " R/sample.R" )
@@ -54,9 +48,11 @@ test_that("cache works", {
54
48
expect_true(cache_up_to_date(ref , path_pkg ))
55
49
56
50
# new root
57
- path_pkg <- local_package(name_tmp_pkg , r_sample = " c" )
51
+ cache <- cache_get()
52
+ path_pkg2 <- local_package(name_tmp_pkg , r_sample = " c" )
53
+ options(" touchstone.hash_source_package" = cache )
58
54
expect_equal(nrow(cache_get()), 2 )
59
- expect_false(cache_up_to_date(ref , path_pkg ))
60
- cache_update(ref , path_pkg )
61
- expect_true(cache_up_to_date(ref , path_pkg ))
55
+ expect_false(cache_up_to_date(ref , path_pkg2 ))
56
+ cache_update(ref , path_pkg2 )
57
+ expect_true(cache_up_to_date(ref , path_pkg2 ))
62
58
})
0 commit comments