Bash functions for running rails unit and functional tests


/ Published in: Bash
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # simple wrappers for running unit and functional tests in rails apps
  2. # INSTEAD OF : ruby test/unit/user_test.rb
  3. # DO THIS : test_unit user
  4. test_unit () {
  5. if [[ -n "$1" ]]; then
  6. ruby test/unit/$1_test.rb;
  7. else
  8. "USAGE : test_unit [name_of_test]"
  9. fi
  10. }
  11.  
  12. # INSTEAD OF : ruby test/functional/users_controller_test.rb
  13. # DO THIS : test_func user
  14. test_func () {
  15. if [[ -n "$1" ]]; then
  16. ruby test/functional/$1_controller_test.rb;
  17. else
  18. "USAGE : test_func [name_of_test]"
  19. fi
  20. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.