On 17/04/11 22:15, Stefan Schulte wrote: > I'm currently writing an integration test for ssh_authorized_key that > basically does the following > > - write a tempfile with a few dummy lines > - apply a catalog with one or more resources > - check the tempfile again > > Now I have a failing test and I dont know why it failed. Is there a way > to see the messages (debug, info etc) that puppet would have printed > during a normal catalog apply? It would help to see if puppet prefetched > the file, detected the necessary change and did flush the file again.
I think you can use a LogCollector as the log destination: logs = [] Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(logs)) .. log something ... .. check the content of logs ... It's even possible there's such thing in the spec helper. Checking... Yes there's one, so it might even be possible to access the logs array directly in the test (I never tried in fact). -- Brice Figureau My Blog: http://www.masterzen.fr/ -- 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.
