Clearing TOPLEVEL_BINDING for reuse

I

Intransition

Is there anyway to delete all the local and instance variables in a
Binding?

I've been working on a test framework and ideally I'd like the tests
to run at the toplevel rather than within the scope of some class. But
to do this I need to clear out the variables between each test script.
 
I

Intransition

There are at least 8 Ruby testing frameworks (that I'm aware of). I
would recommend examining existing implementations. Nothing I could
suggest in this space would be as comprehensive or accurate as the open
source prior art available to you.

Actually it turned out to be quite simple:

Object.new

After all, what is TOPLEVEL anyway?

Funny how things can seem so complicated, but turn out the be so
incredibly simple.

Thanks for the help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,262
Messages
2,571,044
Members
48,769
Latest member
Clifft

Latest Threads

Top