Sha256: 9d7165b40f5dff4cd090ec0de6f4eaaf135caf0b3a2b8316b89a32e755046b8c
Contents?: true
Size: 472 Bytes
Versions: 15
Compression:
Stored size: 472 Bytes
Contents
require 'test/unit' class << Test::Unit::TestCase def test(name, &block) test_name = "test_#{name.gsub(/[\s\W]/,'_')}" raise ArgumentError, "#{test_name} is already defined" if self.instance_methods.include? test_name define_method test_name, &block end def xtest(name, &block) # no-op, an empty test method is defined to prevent "no tests in testcase" errors when all tests are disabled define_method(:test_disabled) { assert true } end end
Version data entries
15 entries across 15 versions & 3 rubygems