# Is there a library/framework that enables me to do unit testing to Ansible playbooks?

**URL:** <https://forum.ansible.com/t/is-there-a-library-framework-that-enables-me-to-do-unit-testing-to-ansible-playbooks/17823>\
**Category:** Ansible Project\
**Created:** [March 23, 2015, 11:53pm UTC](https://forum.ansible.com/t/is-there-a-library-framework-that-enables-me-to-do-unit-testing-to-ansible-playbooks/17823 "2015-03-23T23:53:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sean](https://avatars.discourse-cdn.com/v4/letter/s/f0a364/32.png) [@Sean](https://forum.ansible.com/u/Sean)\
**Post date:** [March 23, 2015, 11:53pm UTC](https://forum.ansible.com/t/is-there-a-library-framework-that-enables-me-to-do-unit-testing-to-ansible-playbooks/17823/1 "2015-03-23T23:53:50Z")

</div>

In Chef’s world, there exists ChefSpec, which basically enables writing and running of ‘unit-tests’ against the Chef Cookbooks.

Is there a counterpart in Ansible community? (If not, how hard to write one as an engineering exercise?)

Thanks,  
Sean

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [March 24, 2015, 12:56am UTC](https://forum.ansible.com/t/is-there-a-library-framework-that-enables-me-to-do-unit-testing-to-ansible-playbooks/17823/2 "2015-03-24T00:56:51Z")

</div>

if you look at test/ in the repo you'll see we use ansible itself to  
test, mostly centered around the assert module.

---

<div class="post-metadata">

**Author:** ![Jonathan\_Davila](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jonathan\_Davila](https://forum.ansible.com/u/Jonathan_Davila)\
**Post date:** [March 24, 2015, 1:39pm UTC](https://forum.ansible.com/t/is-there-a-library-framework-that-enables-me-to-do-unit-testing-to-ansible-playbooks/17823/3 "2015-03-24T13:39:24Z")

</div>

To add to Brian’s response, here is a link to the documentation where a few strategies are enumerated along with example [http://docs.ansible.com/test\_strategies.html](http://docs.ansible.com/test_strategies.html)
