Skip to content

Instantly share code, notes, and snippets.

@technomancy
Created February 24, 2009 23:16
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save technomancy/69862 to your computer and use it in GitHub Desktop.
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