28 Apr '15, 11am

I just published a blog post "Customize #RSpec's output for fun and profit" #Ruby #Rails

I just published a blog post "Customize #RSpec's output for fun and profit" #Ruby #Rails

As you can see, the GroupingFormatter is just a class. In it’s initializer it takes the output as an argument and sets it as an instance variable. Also, on line 2, you can see the aforementioned RSpec.register call. We pass self as the first argument, because we want to register this class as a formatter. The rest of the arguments are method names that RSpec will call when using this formatter. What this means is that when you define a method for the protocol, if you don’t register it – it will not be called. Basically, RSpec won’t know it exists at all.

Full article: http://rubylogs.com/customize-rspecs-output-for-fun-and-p...

Tweets

simple rspec helpers that make testing APIs mor...

rubyflow.com 27 Apr '15, 11am

× The Ruby and Rails community linklog Made a library? Written a blog post? Found a useful tutorial? Share it with the Rub...