P --

I'm not particularly proud of this code, but I don't see an alternative that
> I like better.  Eliminating Puppet::Util::ExecutionStub in favor of a global
> variable seems very clumsy (not to mention that it would leave no place to
> put comments warning that it is intended for spec testing only).  As for
> your "guard" suggestion, I'm not seeing the value that it adds, and I'm wary
> of "at least it's doing something" as an argument for making a change.
>

I realized shortly after sending (alas, also after leaving my computer) that
I was somewhat one-sided in my comments.  I wasn't seeing anything I liked
much better either.

The best suggestion I came up with in the interim was splitting
Puppet::Util#expects into two routines, where the first one retains the name
and tail-chains to the second, which is now exposed for stubbing.

Thinking about it though (and after looking at the code), do you need the
little bit at the top there to be executed?  Why can't you just do something
like:

    Puppet::Util.expects(:execute).with { |command,options| ... }

To be clear this time, I'm not proclaiming that I have a better answer, just
expressing my hope that there is one.

-- M
-----------------------------------------------------------
When in trouble or in doubt, run in circles,
scream and shout. -- 1920's parody of the
maritime general prudential rule
------------------------------------------------------------

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Developers" group.
To post to this group, send email to puppet-dev@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-dev+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-dev?hl=en.

Reply via email to