Skip to content

Commit

Permalink
Add get_links test & quarto install
Browse files Browse the repository at this point in the history
  • Loading branch information
cgoo4 committed Jul 8, 2024
1 parent 3f60bde commit 28813ed
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/pkgdown.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ jobs:
steps:
- uses: actions/checkout@v4

- name: Set up Quarto
uses: quarto-dev/quarto-actions/setup@v2

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r@v2
Expand Down
11 changes: 11 additions & 0 deletions tests/testthat/_snaps/used_there.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,14 @@
! `num_links` must be a scalar
x You've supplied a <integer> object of length 3.

# Get links

Code
get_links(html, "https://www.quantumjitter.com/project/", 5)
Output
[1] "https://www.quantumjitter.com/project/planning/"
[2] "https://www.quantumjitter.com/project/stories/"
[3] "https://www.quantumjitter.com/project/sw10/"
[4] "https://www.quantumjitter.com/project/sets/"
[5] "https://www.quantumjitter.com/project/jitter/"

7 changes: 7 additions & 0 deletions tests/testthat/test-used_there.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,10 @@ test_that("First 3 lines of the first link", {
)
)
})

test_that("Get links", {
html <- rvest::read_html("https://www.quantumjitter.com/project/")
expect_snapshot(
get_links(html, "https://www.quantumjitter.com/project/", 5)
)
})

0 comments on commit 28813ed

Please sign in to comment.