-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Silence is_intact_attr() signaling when called indirectly
- added new conditional logic to silence signaling messages when `is_intact_attr()` is called from within another function (indirectly) - these messages can be confusing to the user when they appear in wrapper functions, where `is_intact_attr()` is (sometimes deeply) nested - fixes #71
- Loading branch information
Showing
7 changed files
with
122 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# user defined `verbose =` param overrides internal logic as expected | ||
|
||
Code | ||
is_intact_attr(iris, verbose = TRUE) | ||
Message | ||
x The object is not a `soma_adat` class object: 'data.frame' | ||
Output | ||
[1] FALSE | ||
|
||
--- | ||
|
||
Code | ||
is_intact_attr(iris, verbose = FALSE) | ||
Output | ||
[1] FALSE | ||
|
||
# verbosity is triggered only when called directly | ||
|
||
Code | ||
is_intact_attr(iris) | ||
Message | ||
x The object is not a `soma_adat` class object: 'data.frame' | ||
Output | ||
[1] FALSE | ||
|
||
--- | ||
|
||
Code | ||
f1(iris) | ||
Output | ||
[1] FALSE | ||
|
||
--- | ||
|
||
Code | ||
f2(iris) | ||
Output | ||
[1] FALSE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
test_that("interactive session can be forced ON, but only within temp scope", { | ||
with_interactive(TRUE, { | ||
expect_true(interactive()) | ||
}) | ||
with_interactive(FALSE, { | ||
expect_false(interactive()) | ||
}) | ||
expect_false(interactive()) # FALSE during testthat | ||
}) |