Skip to content

Instantly share code, notes, and snippets.

@arthurnn
Last active September 25, 2015 00:13
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 arthurnn/99d25007e2ba8f7d77a4 to your computer and use it in GitHub Desktop.
Save arthurnn/99d25007e2ba8f7d77a4 to your computer and use it in GitHub Desktop.
require 'minitest/autorun'
class FooTest < Minitest::Test
def self.before_tests
puts "BEFORE!!!"
end
def self.after_tests
puts "AFTER!!!"
end
(1..10).each { |x| define_method("test_x#{x}") { assert true } }
def self.run *args
before_tests
super
ensure
after_tests
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment