What about this: def App.create(env = (ENV['CAMPING_ENV'] || :development)) end
Then you can simply set ENV['CAMPING_ENV'] = "test" before loading any tests. // Magnus Holm On Tue, Aug 24, 2010 at 16:21, David Susco <dsu...@gmail.com> wrote: > Ya, that's what I'm doing. Just wondering if there was another way to > go about it. I modified your camping-test/base file to call 'create > :test' and specified a test db adapter in my config file to get around > the problem I e-mailed you about. > > Dave > > On Tue, Aug 24, 2010 at 9:44 AM, Magnus Holm <judo...@gmail.com> wrote: >> Why don't add this? >> >> def App.create(env = :development) >> end >> >> And in production, you can call App.create(:production) yourself. >> >> // Magnus Holm >> >> >> >> On Tue, Aug 24, 2010 at 15:36, David Susco <dsu...@gmail.com> wrote: >>> Not talking about having it recycle (I assume all Camping apps have a >>> small carbon footprint). >>> >>> I'm talking about letting the create method know this is the >>> dev/test/prod environment and have it load the appropriate database >>> connection info etc. >>> >>> Any thoughts on this? Having create take an env arguments seems the >>> simplest to me. >>> >>> -- >>> Dave >>> _______________________________________________ >>> Camping-list mailing list >>> Camping-list@rubyforge.org >>> http://rubyforge.org/mailman/listinfo/camping-list >>> >> _______________________________________________ >> Camping-list mailing list >> Camping-list@rubyforge.org >> http://rubyforge.org/mailman/listinfo/camping-list >> > > > > -- > Dave > _______________________________________________ > Camping-list mailing list > Camping-list@rubyforge.org > http://rubyforge.org/mailman/listinfo/camping-list > _______________________________________________ Camping-list mailing list Camping-list@rubyforge.org http://rubyforge.org/mailman/listinfo/camping-list