Add test for db.rb

This library not contain unit test codes.
I will append the tests.