-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove the package down component for now... It fails? * - Disable testing on functions that require interactivity. - Rename open_browser() to open_web_browser() * Add site creation and retrieval failure conditions * Split validating search_site tests * Add a unit test for utilities that modifies system environment variables. * Test the .onLoad() component by verifying options are set. * Remove context * We test a bit more now...
- Loading branch information
Showing
7 changed files
with
105 additions
and
48 deletions.
There are no files selected for viewing
This file was deleted.
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
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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
test_that("Verify package load settings", { | ||
|
||
pkg_default_options = searcher_default_options | ||
pkg_default_names = names(pkg_default_options) | ||
|
||
# Clean environment | ||
for(default_name in pkg_default_names) { | ||
options(default_name = NULL) | ||
} | ||
|
||
is_option_present = function(x) { | ||
!is.null(getOption(x, NULL)) | ||
} | ||
|
||
# Verify names have been unset | ||
expect_true(all(sapply(pkg_default_names, is_option_present))) | ||
|
||
# And call the onload.. | ||
.onLoad() | ||
|
||
# Check if names are registered | ||
expect_true(all(pkg_default_names %in% names(options()))) | ||
|
||
# Verify if contents were set. | ||
set_option_values = sapply(pkg_default_names, getOption, | ||
simplify = FALSE, USE.NAMES = TRUE) | ||
expect_equal( | ||
set_option_values, | ||
pkg_default_options | ||
) | ||
|
||
}) |
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,14 @@ | ||
test_that("Detect RStudio", { | ||
# Obtain value | ||
before = Sys.getenv("RSTUDIO") | ||
|
||
# Modify check environment variable | ||
Sys.setenv("RSTUDIO" = 1) | ||
expect_true(is_rstudio(), info = "Within RStudio") | ||
|
||
Sys.setenv("RSTUDIO" = 0) | ||
expect_false(is_rstudio(), info = "Not in RStudio") | ||
|
||
# Restore | ||
Sys.setenv("RSTUDIO" = before) | ||
}) |