I have an issue while running my specs for a rails application with rake, it freezes on a certain spec. I would like to see what spec is running.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I have pretty funny answer for you.
The problem as I see it is that the name of the spec is written after the success or failure. And in your case it will never happen.
So you can bring a custom formatter! Yes, it will work. The problem is that base formatter defines a lot of points like when group starts, when example starts, but available formatters ( http://github.com/rspec/rspec-core/tree/master/lib/rspec/core/formatters/ ) don’t use the example_started method which is exactly the one you need.
Creating custom formatter is simple – just put this file into the spec/support/formatters/anxious_formatter.rb
Then you can run this with:
The example above is for Rails 3 and RSpec 2.0 – for previous version it will slightly differ. More about custom formatters (for Rails 2 and RSpec 1.x) can be found on the project wiki: https://github.com/dchelimsky/rspec/wiki/custom-formatters
Funny, isn’t it?