Really thought using Defaults would be a winner!  But it doesn't play nice with testthat. Testthat runs the files using eval(). Using setDefaults leads to infinite recursion within testthat!

I'm not sure what you are suggesting to use attach on? 

Kenton White

On Dec 9, 2013, at 9:28 PM, Kirill Müller <notifications@github.com> wrote:

> In tests/3.R:
> 
> > @@ -12,12 +18,12 @@ variable.name <- ProjectTemplate:::clean.variable.name('example_01')
> >  
> >  ProjectTemplate:::csv.reader(data.file, filename, variable.name)
> >  
> > -expect_that(exists(variable.name), is_true())
> > -expect_that(names(get(variable.name)), equals(c('N', 'Prime')))
> > -expect_that(nrow(get(variable.name)), equals(5))
> > -expect_that(ncol(get(variable.name)), equals(2))
> > -expect_that(get(variable.name)[5, 2], equals(11))
> > -rm(example.01)
> > +expect_that(exists(variable.name, envir = env), is_true())
> Then perhaps attach? Or the Defaults package?
> 
> —
> Reply to this email directly or view it on GitHub.
>