inst/tests/test.iProfile.R

#===================================================#
#==== Instruction of generating this package =======#
#==== including load, test and document      =======#
#===================================================#

## load packages
require(devtools)
require(roxygen2)
require(testthat)

## check
# search()

######################
##### Unit Test ######
######################

## write a unit test code first, presume it's called unit_test.R
## an example:
# library(testthat)
# context("filename: current of date")
#
# test_that("filename is current of date", {
#     daystr<-paste(format(Sys.Date(), "%Y%m%d"),".csv",sep="")
#     expect_that(filename(), equals(daystr))
#
#     day<-as.Date("20110701",format="%Y%m%d")
#     expect_that(filename(day), equals("20110701.csv"))
# })

## run unit test for a single file
# source("./inst/tests/unit.test.R")
# test_file("./inst/tests/unit.test.R")

## run unit test for all files inside a directory
# test_dir("./inst/tests/")

## auto-test
# src <- "./R/"
# test <- "./inst/tests/"
# auto_test(src, test)

###############################
##### generate documents ######
###############################
#roxygenise("./")


######################
## package workflow ##
######################
# load_all()
# test()
# document()

## check
check("./")
ShixiangWang/iProfile documentation built on May 11, 2019, 6:25 p.m.