Skip to content
Browse files

Added the screenshot name to the example failure output

  • Loading branch information...
1 parent e35209d commit 21c5ceb22feb23b3c105e81221a4f4e58906a0fd Jeff Moss committed Mar 20, 2012
Showing with 5 additions and 2 deletions.
  1. +5 −2 lib/capybara-screenshot.rb
View
7 lib/capybara-screenshot.rb
@@ -25,7 +25,10 @@
require 'capybara-screenshot/rspec'
RSpec.configure do |config|
config.after do
- Capybara::Screenshot::RSpec.screen_shot_and_save_page if example.exception && example.metadata[:type] == :request
+ if example.exception && example.metadata[:type] == :request
+ image = Capybara::Screenshot::RSpec.screen_shot_and_save_page[:image]
+ example.metadata[:full_description] += "\n Screenshot: #{image}"
+ end
end
end
end
@@ -35,4 +38,4 @@
require 'capybara-screenshot/minitest'
rescue LoadError
# mini test not available
-end
+end

0 comments on commit 21c5ceb

Please sign in to comment.
Something went wrong with that request. Please try again.