Skip to content

Commit f561953

Browse files
authored
Merge pull request #25 from jrdnbradford/main
Testing updates
2 parents 3109495 + 0427fb1 commit f561953

File tree

7 files changed

+28
-8
lines changed

7 files changed

+28
-8
lines changed

.github/workflows/R-CMD-check.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88

99
name: R-CMD-check
1010

11+
permissions: read-all
12+
1113
jobs:
1214
R-CMD-check:
1315
runs-on: ${{ matrix.config.os }}
@@ -29,7 +31,7 @@ jobs:
2931
R_KEEP_PKG_SOURCE: yes
3032

3133
steps:
32-
- uses: actions/checkout@v3
34+
- uses: actions/checkout@v4
3335

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

@@ -47,3 +49,4 @@ jobs:
4749
- uses: r-lib/actions/check-r-package@v2
4850
with:
4951
upload-snapshots: true
52+
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")'

DESCRIPTION

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,11 @@ Suggests:
3737
knitr,
3838
rmarkdown,
3939
spelling,
40-
testthat (>= 2.1.0)
40+
testthat (>= 3.0.0)
4141
VignetteBuilder:
4242
knitr
4343
Encoding: UTF-8
4444
Language: en-US
4545
LazyData: true
4646
RoxygenNote: 7.3.1
47+
Config/testthat/edition: 3

inst/WORDLIST

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
1-
AppVeyor
1+
CMD
22
Codecov
33
DOI
4+
ORCID
5+
cli
6+
dev
47
freecodecamp
58
gi
69
gitignore’
710
io
811
programmatically
12+
rOpenSci
913
ropensci

tests/testthat.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# This file is part of the standard setup for testthat.
2+
# It is recommended that you do not modify it.
3+
#
4+
# Where should you do additional test configuration?
5+
# Learn more about the roles of various files in:
6+
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview
7+
# * https://testthat.r-lib.org/articles/special-files.html
8+
19
library(testthat)
210
library(gitignore)
311

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
test_that("gi_available_templates works", {
2+
templates <- gi_available_templates()
3+
4+
expect_true(inherits(templates, "character"))
5+
expect_true(is.vector(templates))
6+
expect_true("r" %in% templates)
7+
})

tests/testthat/test_gi_fetch_templates.R renamed to tests/testthat/test-gi_fetch_templates.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,8 @@
1-
is_clipr_available <- clipr::clipr_available(allow_non_interactive = TRUE)
2-
skip_msg <- "System clipboard is not available - skipping test."
3-
41
test_that("gi_fetch_templates inputs", {
52
skip_on_cran()
63
skip_if_offline()
74

8-
expect_error(gi_fetch_templates("a-non-valide-template"))
5+
expect_error(gi_fetch_templates("a-non-valid-template"))
96
expect_error(gi_fetch_templates("R", copy_to_clipboard = "A"))
107
expect_error(gi_fetch_templates("R", copy_to_clipboard = 1))
118
expect_error(gi_fetch_templates("R", append_gitignore = "A"))
@@ -55,4 +52,4 @@ test_that("A non existing .gitignore file can be created", {
5552
)
5653

5754
unlink(f)
58-
})
55+
})

0 commit comments

Comments
 (0)