context("Base model in Cod_2_Selectivity runs")
ExampleFilePath<-system.file("extdata",package="GeMS")
truedir<-file.path(ExampleFilePath, "Cod_2_Selectivity")
MSEdir<-system.file("tests",package="GeMS")
CTLfilename<-"Cod_Selectivity_CTL"
CTLfilepath<-file.path(truedir,paste0(CTLfilename,".csv"))
test_that("Cod_Selectivity_CTL exists.", {
expect_true(file.copy(from=CTLfilepath,to=MSEdir,overwrite=T))
})
CTLfile<-ReadCTLfile(file.path(MSEdir,CTLfilename))
test_that("Cod_Selectivity_CTL reads in.", {
expect_equal(sum(is.na(CTLfile$OM)), 0)
})
test_that("Cod_Selectivity_CTL runs.", {
newCTLfile<-CTLfile
newCTLfile$OM$Nsim<-1
newCTLfile$OM$SimYear<-newCTLfile$OM$InitYear+1
GeMS(newCTLfile,CTLfilename,MSEdir,silent=T)
Dirname<- file.path(MSEdir,CTLfilename)
expect_equal(sum(file.exists(file.path(Dirname,"ProdOutputs.csv"))),1)
unlink(file.path(MSEdir,paste0(CTLfilename,".csv")))
unlink(Dirname,recursive=T)
unlink(file.path(MSEdir,"plots"),recursive=T)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.