# Assert the mysql user and database

**URL:** <https://discourse.chef.io/t/assert-the-mysql-user-and-database/4119>\
**Category:** Chef Infra (archive)\
**Created:** [June 21, 2013, 8:22am UTC](https://discourse.chef.io/t/assert-the-mysql-user-and-database/4119 "2013-06-21T08:22:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![millisami\_r](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/millisami_r/32/418_2.png) [@millisami\_r](https://discourse.chef.io/u/millisami_r)\
**Post date:** [June 21, 2013, 8:22am UTC](https://discourse.chef.io/t/assert-the-mysql-user-and-database/4119/1 "2013-06-21T08:22:09Z")

</div>

I’m writing a lwrp for a php app using the test-kitchen, berkshelf and minitest-chef-handler

Here is the example spec I’m using [https://github.com/calavera/minitest-chef-handler/blob/v0.4.0/examples/spec\_examples/files/default/tests/minitest/example\_test.rb](https://github.com/calavera/minitest-chef-handler/blob/v0.4.0/examples/spec_examples/files/default/tests/minitest/example_test.rb)

But one thing I’m confused about is how to assert the mysql user is created with privileges on the particular database.  
The example doesn’t have such assertion. I am using the database cookbook’s lwrp to create db user and database.

How do I test it?

* * *

@millisami  
~ Sachin Sagar Rai  
Ruby on Rails Developer  
[http://tfm.com.np](http://tfm.com.np)  
[http://nepalonrails.com](http://nepalonrails.com) ([http://nepalonrails.tumblr.com](http://nepalonrails.tumblr.com))  
[http://funsole.com](http://funsole.com)  
Sent with Sparrow ([http://www.sparrowmailapp.com/?sig](http://www.sparrowmailapp.com/?sig))
