Help with Test


I created a rails project named 'Hi'. I didn't do anything in it
1. Rails Hi
2. Ruby script/generate controller hi

thats it.

Now I went to Test\funcational folder and run the
Hi_controller_test.rb and I am getting 2 MySql Error even though I am
not using MySql in this project at all.

Could some one tell me what am I doing wrong?


Rails uses a database by default. If you look in config/database.yml, you’ll see what Rails is trying to connect to.


Thanks and yes I did find the database.yml where when I entered valid
database information it worked. But my question is, what if I am
writing a program which doesn't use database at all, how can I exclude
the mysql from my testing instead of creating a dummy database.

You need to hack Rails itself. I submitted a patch that allows doing this by just removing database.yml:

though as it’s yet to be accepted you’ll have to apply the patch yourself.


Excellent. Thanks for the info, thats what i was looking for.

Yes I applied the patch is working excellent.

Good to hear, now if we could just get it committed into Rails itself…