Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Spec-style it-should minitest syntax in ten lines
require 'rubygems'
require 'minitest/unit'
class MiniTest::Unit
def TestCase.test_methods
methods = public_instance_methods(true).map { |m| m.to_s }
methods -= MiniTest::Unit::TestCase.public_instance_methods(true)
methods.sort_by { |m| test_order == :random ? rand : m }
end
end
class Testtr < MiniTest::Unit::TestCase
class << self
alias_method :it, :define_method
end
it("should go wild") { assert false }
def test_should_run_tests
assert true
end
end
MiniTest::Unit.autorun
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment