[rspec-devel] [ rspec-Feature Requests-6651 ] Ability to query whether a spec has failed or not in teardown

noreply at rubyforge.org noreply at rubyforge.org
Mon Nov 13 13:39:52 EST 2006


Feature Requests item #6651, was opened at 2006-11-13 13:39
You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6651&group_id=797

Category: None
Group: None
Status: Open
Priority: 3
Submitted By: Aslak Hellesøy (aslak_hellesoy)
Assigned to: Aslak Hellesøy (aslak_hellesoy)
Summary: Ability to query whether a spec has failed or not in teardown

Initial Comment:
I'm using RSpec to drive Watir. When a spec fails, I want to take a screenshot before closing the browser in teardown. (Screenshotting is supported by Watir). Example:

teardown do
  if failed?
    screenshot_file_name = "#{context_name} #{spec_name}.jpg".gsub!(/\s/, "_")
    screen_capture(screenshot, true)
  end
  @ie.close
end

3 new methods that need to be available in teardown:

failed?
context_name
spec_name


----------------------------------------------------------------------

You can respond by visiting: 
http://rubyforge.org/tracker/?func=detail&atid=3152&aid=6651&group_id=797


More information about the rspec-devel mailing list