-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make is_interactive()
react to "rlang_interactive" option
#734
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,13 +111,19 @@ test_that("oob must be a flag", { | |
}) | ||
|
||
test_that("can not use oob in non-interactive session", { | ||
old <- options() | ||
on.exit(options(old)) | ||
options(rlang_interactive = FALSE) | ||
|
||
Comment on lines
+114
to
+117
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test would previously fail when run with |
||
expect_error(check_oob(TRUE), "interactive") | ||
}) | ||
|
||
test_that("can not use custom oob value without enabling oob", { | ||
testthat::skip_if_not_installed("httpuv") | ||
with_mock( | ||
`httr:::is_interactive` = function() TRUE, | ||
expect_error(check_oob(FALSE, "custom_value"), "custom oob value") | ||
) | ||
|
||
old <- options() | ||
on.exit(options(old)) | ||
options(rlang_interactive = TRUE) | ||
Comment on lines
+124
to
+126
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Took the chance to get rid of the |
||
|
||
expect_error(check_oob(FALSE, "custom_value"), "custom oob value") | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't use
rlang::is_interactive()
because httr does not depend on rlang at this point. And it doesn't seem worth bringing a whole standalone file in for this.