tests/testthat/test-api.R

context('test-api.R')

test_that('Sentenai takes your auth_key and host', {
  key <- 'abc123'
  host <- 'https://other.sentenai.com'

  s <- sentenaiWithKey(key, host=host)
  expect_equal(s$auth_key, key)
  expect_equal(s$host, host)
})

test_that('Sentenai has default host', {
  key <- 'abc123'
  host <- 'https://api.sentenai.com'

  s <- sentenaiWithKey(key)
  expect_equal(s$auth_key, key)
  expect_equal(s$host, host)
})
Sentenai/r-sentenai documentation built on May 17, 2019, 6:34 p.m.