Skip to content

Commit 1b66241

Browse files
committed
More general grooming of test skips
1 parent e445c4d commit 1b66241

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

tests/testthat/test-course.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ test_that("tidy_download() errors early if destdir is not a directory", {
6262

6363
test_that("tidy_download() works", {
6464
skip_on_cran()
65-
skip_if_offline()
65+
skip_if_offline("github.com")
6666

6767
tmp <- withr::local_tempdir(pattern = "tidy-download-test-")
6868

@@ -193,10 +193,10 @@ test_that("conspicuous_place() uses `usethis.destdir` when set", {
193193
})
194194

195195
test_that("use_course() errors if MIME type is not 'application/zip'", {
196-
path <- withr::local_tempdir()
197-
198196
skip_on_cran()
199197
skip_if_offline()
198+
199+
path <- withr::local_tempdir()
200200
expect_usethis_error(
201201
use_course("https://httpbin.org/get", destdir = path),
202202
"does not have MIME type"

tests/testthat/test-github-actions.R

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
test_that("use_github_action() allows for custom urls", {
2+
skip_on_cran()
23
skip_if_no_git_user()
34
skip_if_offline()
4-
skip_on_cran()
5+
56
local_interactive(FALSE)
67

78
create_local_package()
@@ -21,9 +22,9 @@ test_that("use_github_action() allows for custom urls", {
2122
})
2223

2324
test_that("use_github_action() appends yaml in name if missing", {
25+
skip_on_cran()
2426
skip_if_no_git_user()
2527
skip_if_offline()
26-
skip_on_cran()
2728
local_interactive(FALSE)
2829

2930
create_local_package()
@@ -38,9 +39,9 @@ test_that("use_github_action() appends yaml in name if missing", {
3839
})
3940

4041
test_that("uses_github_actions() reports usage of GitHub Actions", {
42+
skip_on_cran()
4143
skip_if_no_git_user()
4244
skip_if_offline()
43-
skip_on_cran()
4445
local_interactive(FALSE)
4546

4647
create_local_package()
@@ -65,9 +66,9 @@ test_that("check_uses_github_actions() can throw error", {
6566
})
6667

6768
test_that("use_github_actions() configures the basic check action", {
69+
skip_on_cran()
6870
skip_if_no_git_user()
6971
skip_if_offline()
70-
skip_on_cran()
7172
local_interactive(FALSE)
7273

7374
create_local_package()
@@ -93,9 +94,9 @@ test_that("use_github_actions() configures the basic check action", {
9394
})
9495

9596
test_that("use_tidy_github_actions() configures the full check and pr commands", {
97+
skip_on_cran()
9698
skip_if_no_git_user()
9799
skip_if_offline()
98-
skip_on_cran()
99100
local_interactive(FALSE)
100101

101102
create_local_package()

tests/testthat/test-tidyverse.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ test_that("use_tidy_description() alphabetises dependencies and remotes", {
1313
})
1414

1515
test_that("use_tidy_dependencies() isn't overly informative", {
16-
skip_if_offline()
1716
skip_on_cran()
17+
skip_if_offline("github.com")
1818

1919
create_local_package(fs::path_temp("tidydeps"))
2020
use_package_doc()

0 commit comments

Comments
 (0)