technomancy (owner)

Revisions

gist: 69862 Download_button fork
public
Description:
Spec-style it-should minitest syntax in ten lines
Public Clone URL: git://gist.github.com/69862.git
Embed All Files: show embed
testtr.rb #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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