[rspec-users] how can I get prettier failure messages for integration specs?

David Chelimsky dchelimsky at gmail.com
Thu Apr 19 05:14:46 UTC 2012

On Wednesday, April 18, 2012 at 11:30 PM, Patrick J. Collins wrote:
> On Wed, 18 Apr 2012, David Chelimsky wrote:
> > If you're using capybara you could put save_and_open_page in an after hook. You'd still get the console output, but at least you'd see
> > the page in a browser.
> > 
> Is there a way to make that happen only upon failures during integration
> tests?

Try this:

RSpec.configure do |c|
  c.after(:each, :type => :request) do
    save_and_open_page if example.exception
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120419/7e9697d7/attachment.html>

More information about the rspec-users mailing list