Sha256: 2225d47b35650e4bccfc8c0088548144cc2144da80c8c669d9a381ec9ac38d9a
Contents?: true
Size: 576 Bytes
Versions: 14
Compression:
Stored size: 576 Bytes
Contents
require 'rubygems' require 'test/unit' #require 'shoulda' require 'mocha' require File.dirname(__FILE__) + '/../lib/carrot' 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
14 entries across 14 versions & 6 rubygems