-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #220 from atorus-research/219-withr
Closes #219 Uses `{withr}` to create temporary files and graceful handling of Suggests
- Loading branch information
Showing
11 changed files
with
118 additions
and
132 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
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
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
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 |
---|---|---|
@@ -1,21 +1,21 @@ | ||
test_that(".onLoad: Unset options get initialised on package load with defaults", { | ||
skip_if(getOption("testthat_interactive")) | ||
withr::with_options( | ||
list(xportr.df_domain_name = NULL), | ||
with_options( | ||
{ | ||
expect_no_error(.onLoad()) | ||
expect_equal(getOption("xportr.df_domain_name"), "dataset") | ||
} | ||
}, | ||
xportr.df_domain_name = NULL | ||
) | ||
}) | ||
|
||
test_that(".onLoad: Initialised options are retained and not overwritten", { | ||
skip_if(getOption("testthat_interactive")) | ||
withr::with_options( | ||
list(xportr.df_domain_name = "custom_domain"), | ||
with_options( | ||
{ | ||
expect_no_error(.onLoad()) | ||
expect_equal(getOption("xportr.df_domain_name"), "custom_domain") | ||
} | ||
}, | ||
xportr.df_domain_name = "custom_domain" | ||
) | ||
}) |
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
Oops, something went wrong.