Skip to content

Instantly share code, notes, and snippets.

@kulte
Created May 6, 2013 01:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kulte/5522956 to your computer and use it in GitHub Desktop.
Save kulte/5522956 to your computer and use it in GitHub Desktop.
##
# Runs a single test with setup/teardown hooks.
def run
with_info_handler do
time_it do
capture_exceptions do
before_setup; setup; after_setup
self.send self.name
end
%w{ before_teardown teardown after_teardown }.each do |hook|
capture_exceptions do
self.send hook
end
end
end
end
self # per contract
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment