From: Intransition on
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.

From: Rein Henrichs on
On 2010-06-05 11:40:25 -0700, Intransition said:

> 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.

Binding objects are not mutable, nor would I suggest this as an
implementation strategy.

Rein Henrichs
http://puppetlabs.com
http://reinh.com

From: Intransition on
On Jun 5, 3:05 pm, Rein Henrichs <re...(a)reinh.com> wrote:
> On 2010-06-05 11:40:25 -0700, Intransition said:
>
> > 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.
>
> Binding objects are not mutable, nor would I suggest this as an
> implementation strategy.

Any suggestions?

From: Rein Henrichs on
On 2010-06-05 17:09:06 -0700, Intransition said:

> On Jun 5, 3:05�pm, Rein Henrichs <re...(a)reinh.com> wrote:
>> On 2010-06-05 11:40:25 -0700, Intransition said:
>>
>>> 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.
>>
>> Binding objects are not mutable, nor would I suggest this as an
>> implementation strategy.
>
> Any suggestions?

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.

--
Rein Henrichs
http://puppetlabs.com
http://reinh.com

From: Intransition on
On Jun 5, 8:20 pm, Rein Henrichs <re...(a)reinh.com> wrote:

> 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.