Check of we are in rails and use rake test

Signed-off-by: Jeroen van Baarsen <jeroenvanbaarsen@gmail.com>