I have this piece of code in my recipe now i want to write a chefspec to test the code before it is being executed on the node.
I have googled for some sample spec recipe but i couldn't find anything related to databags.
userlist = data_bag('systemuser')
userlist.each do | identifier|
users = data_bag_item('systemuser', identifier)
user(users['id']) do
comment users['comment']
end
end
I need some help on how to write spec for testing the above mentioned code.