jeudi 9 juillet 2015

chefspec for testing databag in recipe

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 googled for some sample spec recipe but i couldnt 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

need some help on how to write spec for testing the above mentioned code.

Aucun commentaire:

Enregistrer un commentaire