10

AS the guides, the command used to prepare test database is

bundle exec rake db:test:prepare

However, I have found that following command also works & created the test db for me.

bundle exec rake test:prepare

Wanted to know if this is a valid command, if yes. Where can I find the documentation.

tested on rails 3.2.8

Samiron
  • 5,169
  • 2
  • 28
  • 55
CuriousMind
  • 33,537
  • 28
  • 98
  • 137

1 Answers1

12

According to github and the source code task 'test:prepare' => 'db:test:prepare' is mentioned at the bottom.

Hence it's a shortcut, wrapper, whatever you want to call it. Another question would be why this doesn't up when you do bundle exec rake -T but hey.

MarkDBlackwell
  • 1,994
  • 18
  • 27
pjammer
  • 9,489
  • 5
  • 46
  • 56
  • 2
    So, I found a easter egg in rails :) – CuriousMind Aug 28 '12 at 16:35
  • 4
    Only rake tasks with a `desc "some description"` before the task definition will show up with `rake -T`. I'm guessing that the `test:prepare` task is missing this. – Eric Hu Jun 28 '13 at 23:58
  • 2
    These don't actually appear to be aliases for one another, if you look at the source. test:prepare has more prerequisites than db:test:prepare. – Derek Prior Dec 18 '13 at 02:39