Skip to content

Commit

Permalink
Fix for changed usethis message and don't fail on CRAN for this reaso…
Browse files Browse the repository at this point in the history
…n again.
  • Loading branch information
Rory Nolan committed Aug 17, 2024
1 parent 8240a1c commit 42ece38
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 10 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: exampletestr
Title: Help for Writing Unit Tests Based on Function Examples
Version: 1.7.1
Version: 1.7.2
Authors@R:
c(person(given = "Rory",
family = "Nolan",
Expand Down Expand Up @@ -61,4 +61,4 @@ Config/testthat/edition: 2
Encoding: UTF-8
Language: en-US
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
RoxygenNote: 7.3.2
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# `exampletestr` 1.7.2

## BUG FIXES
* `usethis` had breaking changes for which `exampletestr` needed to be fixed.


# `exampletestr` 1.7.1

## BUG FIXES
Expand Down
6 changes: 0 additions & 6 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
## Test environments
* local OS X install, R 4.2.1
* ubuntu 14.04 (on github actions), R 4.2.1
* Windows Server 2012 (on github actions), R 4.2.1
* win-builder (devel and release)

## R CMD check results
0 errors | 0 warnings | 0 notes

Expand Down
8 changes: 6 additions & 2 deletions tests/testthat/test-example-extraction.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,16 @@ teardown({
fs::dir_delete(tmp_dir)
})

test_that("`extract_examples()` works", {
test_that("`extract_examples()` error works", {
skip_on_cran() # testing an error message from another package
expect_error(
extract_examples("detect", tempdir(check = TRUE)),
"Path .+ does not appear to be inside a project or package.",
"Path.+does not appear to be inside a project or package.",
class = "usethis_error"
)
})

test_that("`extract_examples()` works", {
fs::file_copy(system.file("extdata", "detect.R",
package = "exampletestr"
), paste0(pkg_dir, "/R"))
Expand Down

0 comments on commit 42ece38

Please sign in to comment.