Skip to content

Commit

Permalink
expect title in README fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Toby Dylan Hocking committed Aug 29, 2024
1 parent 84eff9b commit 416c19c
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion R/data.R
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@
#' Housing sales in TX.
#'
#' Information about the housing market in Texas provided by the TAMU
#' real estate center, \url{https://www.recenter.tamu.edu/}.
#' real estate center.
#'
#' @format A data frame with 8602 observations and 9 variables:
#' \describe{
Expand Down
3 changes: 0 additions & 3 deletions R/stat-unique.r
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
#' Remove duplicates.
#'
#' @section Aesthetics:
#' \Sexpr[results=rd,stage=build]{animint2:::rd_aesthetics("stat", "unique")}
#'
#' @export
#' @inheritParams layer
#' @inheritParams geom_point
Expand Down
2 changes: 1 addition & 1 deletion R/z_pages.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ animint2pages <- function(plot.list, github_repo, commit_message = "Commit from
manage_gh_pages(repo, to_post, local_clone, commit_message)
message(sprintf(
"Visualization will be available at %s\nDeployment via GitHub Pages may take a few minutes...", viz_url))
viz_owner_repo
list(owner_repo=viz_owner_repo, local_clone=local_clone, viz_url=viz_url, gh_pages_url=sprintf("https://github.com/%s/tree/gh-pages", viz_owner_repo))
}

initial_commit <- function(local_clone, repo, viz_url) {
Expand Down
5 changes: 0 additions & 5 deletions man/stat_unique.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/txhousing.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 10 additions & 3 deletions tests/testthat/test-compiler-ghpages.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
acontext("GitHub Pages")

library(animint2)
viz <- animint(
title="one to ten",
source="https://github.com/animint/animint2/tree/master/tests/testthat/test-compiler-ghpages.R",
Expand All @@ -22,9 +23,15 @@ test_that("error for viz with no source", {
}, "plot.list does not contain option named source, which is required by animint2pages")
})

test_that("animint2pages() returns owner/repo string", {
viz_owner_repo <- animint2pages(viz, github_repo = "animint2pages_test_repo")
expect_is(viz_owner_repo, "character")
test_that("animint2pages() returns list of meta-data", {
result_list <- animint2pages(viz, github_repo = "animint2pages_test_repo")
expect_match(result_list$owner_repo, "animint2pages_test_repo")
expect_match(result_list$viz_url, "github.io/animint2pages_test_repo")
expect_match(result_list$gh_pages_url, "animint2pages_test_repo/tree/gh-pages")
README.md <- file.path(result_list$local_clone, "README.md")
README.lines <- readLines(README.md)
expected.line <- paste("##", viz$title)
expect_identical(README.lines[1], expected.line)
})

test_that("animint2pages raises an error if no GitHub token is present", {
Expand Down

0 comments on commit 416c19c

Please sign in to comment.