On Nov 5, 2009, at 2:32 PM, Peter Meier wrote:
>
>> It'd be nice to have the tests demonstrate that something is done
>> with
>> stderr, but otherwise the patch looks good.
>
> I was thinking about that too, in general I was thinking about mocking
> popen3, however this doesn't seem to be trivial, but I can try. Give
> me
> some days.
It shouldn't be too hard; something like:
it "should produce stderr content as a warning if debug is enabled" do
stdout = stdin = stub 'fh', :readlines => []
stderr = stub 'stderr', :readlines => %w{my content}
Open3.expects(:popen3).with("/my/code").yields(stdin, stdout, stderr)
Resolution.expects(:warn).with { |msg| msg.include?("my content") }
Resolution.exec
end
Something like that anyway. :)
--
This space intentionally has nothing but text explaining why this
space has nothing but text explaining that this space would otherwise
have been left blank, and would otherwise have been left blank.
---------------------------------------------------------------------
Luke Kanies | http://reductivelabs.com | http://madstop.com
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Puppet Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/puppet-dev?hl=en
-~----------~----~----~----~------~----~------~--~---