Use a rake task to describe your Test::Unit tests
I've been considering switching to RSpec / BDD for my Rails projects, but after thinking about it I realized that all I really wanted was the nice output from the Spec command that described my code. I figured that there had to be a way to do this with my existing Test::Unit tests... so I wrote this quickly:
https://gist.github.com/3935459
As it so happens, despite how rough it is, it actually does a pretty good job!
Just place the rake file in your lib/tasks/ folder and call it like this:
rake test:describe
You can also call a specific class by passing it to rake as an argument:
rake test:describe[User]
The code is rough and definitely conforms to my way of writing tests, but I hope you can find it useful at least as a starting point for your projects.
Written by Jeremy Baker
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#