-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testing notification of custom LWRPs does not behave correctly #546
Comments
You need to step_into the LWRP if you want to test this. |
I tried to step_into the LWRP with no effect. |
@yves-vogl it should be |
Sorry - I fixed it in the example above. But error was just in the example. |
@yves-vogl can you put together a PR that shows the failing test? Please use the cucumber tests and follow the existing patterns in place. |
Give a me a few days and I'll get back to you with a PR |
ChefSpec is testing the catalog. So, it is correct to say each of those resources does cause a notification to be set up in the catalog. You need an integration test to determine if a specific event causes a notification to actually be sent. This is my understanding of what you're describing here. |
@sethvargo Could you please reopen this issue? |
Please see my response on your PR |
@yves-vogl also, @dblessing gave a much shorter explanation than mine, which is correct. |
@sethvargo I spent a good amount of time on the same problem before I found this Github issue. I totally get the explanation, so thanks for that. However, I am wondering if since ChefSpec will always assume that resources notify, maybe something like Maybe I am not sure where to draw the line between ChefSpec and actual integration tests. |
Imaging a simple LWRP test.
This means, that only if I create the resource test[bar], it fires its notifications.
test[foo], shouldn't fire a notification.
The appropriate tests could look like this:
And the matcher
Now, when you run this test, it's saying:
The text was updated successfully, but these errors were encountered: