is there any way to get rspec to tell you the contents of the catalog on a failure?

21 views
Skip to first unread message

Johnson Earls

unread,
Jul 20, 2015, 8:31:07 PM7/20/15
to puppet...@googlegroups.com
Another rspec question:

Is there any way to get rspec to tell you, when a test fails, what the contents of the catalog was, at a high level at least, that generated the failure?

I've got a code block that looks right to me, and an rspec test that looks right to me.  the test is failing and I have no idea why.  Maybe seeing the contents of the catalog would help me figure out what's going on.

Thanks in advance,
- Johnson

Hunter Haugen

unread,
Jul 22, 2015, 1:04:13 PM7/22/15
to puppet...@googlegroups.com
When I get a vague failure, such as "expect File[/whatever] to be in the catalog" and don't know why it's not, I put a pry in the `it` block before the test failure and re-run. It will drop you into a pry prompt and you can inspect the catalog manually by running `catalogue` and look for anything that looks weird.

There is no great way to dump the catalog on failure automatically though.

--
You received this message because you are subscribed to the Google Groups "Puppet Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to puppet-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/puppet-users/f60d5256-2333-4953-8228-5da675f8679d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages