Sha256: 84c04ced5c9c286be1fe2c4fda22188ef96adb769a09dffe3e96b6ddb0b7f8c3
Contents?: true
Size: 430 Bytes
Versions: 7
Compression:
Stored size: 430 Bytes
Contents
require 'test/unit' require 'pp' TEST_FILE = File.dirname(__FILE__) + '/test.txt' unless defined?(TEST_FILE) unless Test::Unit::TestCase.respond_to?(:test) 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 end end
Version data entries
7 entries across 7 versions & 2 rubygems