Browse Source

basic tests

master
boB Rudis 7 years ago
parent
commit
2f76c6275a
No known key found for this signature in database GPG Key ID: 2A514A4997464560
  1. 4
      README.md
  2. 10
      tests/testthat/test-hgr.R

4
README.md

@ -72,13 +72,13 @@ library(testthat)
date() date()
``` ```
## [1] "Wed Sep 13 14:41:50 2017" ## [1] "Wed Sep 13 14:44:54 2017"
``` r ``` r
test_dir("tests/") test_dir("tests/")
``` ```
## testthat results ======================================================================================================== ## testthat results ========================================================================================================
## OK: 0 SKIPPED: 0 FAILED: 0 ## OK: 1 SKIPPED: 0 FAILED: 0
## ##
## DONE =================================================================================================================== ## DONE ===================================================================================================================

10
tests/testthat/test-hgr.R

@ -1,6 +1,14 @@
context("basic functionality") context("basic functionality")
test_that("we can do something", { test_that("we can do something", {
#expect_that(some_function(), is_a("data.frame")) story <- "https://www.nytimes.com/2017/04/18/world/asia/aircraft-carrier-north-korea-carl-vinson.html?hp&action=click&pgtype=Homepage&clickSource=story-heading&module=first-column-region&region=top-news&WT.nav=top-news&_r=0"
doc <- just_the_facts(story)
plain <- clean_text(doc$content)
expect_equal(
substr(plain, 1, 100),
"WASHINGTON — Just over a week ago, the White House declared that ordering an American aircraft carri"
)
}) })

Loading…
Cancel
Save