Skip to content

Commit

Permalink
normalize path for comparaison in test (rstudio#1196)
Browse files Browse the repository at this point in the history
fix tests following afadf50
  • Loading branch information
cderv authored Jul 6, 2021
1 parent afadf50 commit ae967ee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/testthat/test-site.R
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
test_that("find_book_proj() correction found the root dir", {
book_dir <- local_book()
book_dir <- xfun::normalize_path(local_book())
withr::local_dir(book_dir)
expect_equal(normalizePath(find_book_proj(".")), book_dir)
expect_equal(normalizePath(find_book_proj("01-Introduction.Rmd")), book_dir)
expect_equal(find_book_proj("."), book_dir)
expect_equal(find_book_proj("01-Introduction.Rmd"), book_dir)
gsub("^(site:.*)$", "\\1 # any comment", xfun::read_utf8("index.Rmd"))
xfun::gsub_file("index.Rmd", pattern = "^(site:.*)$", replacement = "\\1 # any comment")
expect_equal(normalizePath(find_book_proj(".")), book_dir)
expect_equal(find_book_proj("."), book_dir)
})

0 comments on commit ae967ee

Please sign in to comment.