I’m using a before block in my spec to stub the result of a data_bag call
in my cookbook.
What I don’t get, is what I’m supposed to write in my « it » block to make
sure that I wrote the code to create as many users as there are in the data
In my recipe I will obviously do something like this (from chefspec github
data_bag(‘users’).each do |user|
In my spec I have
With an entry that corresponds to the user I added to my databag.
But next ? Is the following sufficient :
it ‘performs the action’ do
Where I’m supposed to repeat the object given as a parameter in the stub
Or am I supposed to call the data_bag method in the it block witch will
fetch the data stubbed rather
than real data ?
Thanks in advance