RSpec: How do I reload the environment?

Hi

I’m writing a series of RSpec tests for a Rails plugin. In some of
these tests I use meta-programming (using class_eval) to change core
features of my environment. But these changes to the environment also
affect the following tests that come after. Is there a way to reload
the environment either before or after a certain test has run, or
maybe before or after a certain spec file?

/thomas

On Jan 14, 5:54 pm, dan yoder [email protected] wrote:

Main page:http://dev.zeraweb.com/autoload/

Hi dan…

Great :slight_smile: But it seems that the server has problems… I get a 500,
trying to load the URL.

Hi Thomas,

You can use Autocode for that. You mixin Autoload into the module(s)
that you want to reload, specify which directories you want to load
files from for that module, and then just call reload. This will
actually remove anything that was autoloaded from memory (different
than simply reloading it, which can sometimes leave artifacts) and
then reload it the next time it’s referenced.

Main page:
http://dev.zeraweb.com/autoload/

HTH,
Dan

On Jan 15, 5:10 pm, Thomas W. [email protected] wrote:

On Jan 14, 5:54 pm, dan yoder [email protected] wrote:

Main page:http://dev.zeraweb.com/autoload/

Hi dan…

Great :slight_smile: But it seems that the server has problems… I get a 500,
trying to load the URL.

i see the same error too.