-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
592ee71
commit 0f25842
Showing
3 changed files
with
40 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# This file is part of the standard setup for testthat. | ||
# It is recommended that you do not modify it. | ||
# | ||
# Where should you do additional test configuration? | ||
# Learn more about the roles of various files in: | ||
# * https://r-pkgs.org/testing-design.html#sec-tests-files-overview | ||
# * https://testthat.r-lib.org/articles/special-files.html | ||
|
||
library(testthat) | ||
library(rspell) | ||
|
||
test_check("rspell") |
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,25 @@ | ||
text_string <- "O rato roeu a roupa do rei de roma." | ||
|
||
test_that("expect error if text is not set", { | ||
expect_error(check_text(text = NULL)) | ||
}) | ||
|
||
test_that("expect error if text is not character", { | ||
expect_error(check_text(text = TRUE)) | ||
}) | ||
|
||
test_that("expect error if language is not set", { | ||
expect_error(check_text(text = text_string, language = NULL)) | ||
}) | ||
|
||
test_that("expect error if language is not set", { | ||
expect_error(check_text(text = text_string, language = NULL)) | ||
}) | ||
|
||
test_that("expect error if language if not supported", { | ||
expect_error(check_text(text = text_string, language = "blabla")) | ||
}) | ||
|
||
test_that("expect a tibble as responde", { | ||
expect_true(tibble::is_tibble(check_text(text = text_string, language = "pt-BR"))) | ||
}) |