Skip to content

Instantly share code, notes, and snippets.

@mjc-gh
Last active June 13, 2020 16:14
Show Gist options
  • Save mjc-gh/3889606 to your computer and use it in GitHub Desktop.
Save mjc-gh/3889606 to your computer and use it in GitHub Desktop.
Minitest methods
require 'minitest/autorun'
class Minitest::Test
def self.test(name, &block)
define_method "test_#{name.gsub(/\s+/, '_')}", &block
end
def self.setup(&block)
define_method :setup, &block
end
def self.teardown(&block)
define_method :teardown, &block
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment