Skip to content

Commit

Permalink
add options tests
Browse files Browse the repository at this point in the history
  • Loading branch information
David Muhr committed Dec 14, 2017
1 parent 9bc205e commit 751c71e
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
5 changes: 5 additions & 0 deletions R/options.R → R/stopwords-options.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,8 @@ stopwords_options <- function() {
smart = "data_stopwords_smart")
)
}

# Load options on attach
.onAttach <- function(...) {
stopwords_options()
}
3 changes: 0 additions & 3 deletions R/zzz.R

This file was deleted.

2 changes: 1 addition & 1 deletion man/stopwords_options.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions tests/testthat/test-stopwords_options.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
context("stopwords_options")

test_that("all files in data/ found in sources", {
files <- list.files(file.path("..", "..", "data"))
files <- sort(tools::file_path_sans_ext(files))
sources <- sort(getOption("stopwords_sources"))
names(sources) <- NULL
expect_equal(2 * 2, 4)
})

0 comments on commit 751c71e

Please sign in to comment.