まあ、なんと云ふか、めんどくさかったりするし、D言語のunittest blockが羨ましかったりするし(〃l _ l)
assertion丈使ひたいので、Module: Test::Unit::Assertions (Ruby 2.0)を読み込む。
下記を読めば解る。
$DEBUG = true
# @param test_name [String]
def unittest test_name, &proc
if $DEBUG
proc.call
puts "#{test_name} ok."
end
end
if $DEBUG
require 'test/unit/assertions'
include Test::Unit::Assertions
end
unittest 'test of test' do
assert_equal 2, 1 + 1
end