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

Version Path
Bira-sweat_shop-1.0.0 test/test_helper.rb
famoseagle-sweat_shop-0.3.0 test/test_helper.rb
famoseagle-sweat_shop-0.5.0 test/test_helper.rb
famoseagle-sweat_shop-0.6.0 test/test_helper.rb
famoseagle-sweat_shop-0.7.0 test/test_helper.rb
famoseagle-sweat_shop-0.8.0 test/test_helper.rb
famoseagle-sweat_shop-0.8.1 test/test_helper.rb
famoseagle-sweat_shop-0.8.2 test/test_helper.rb
famoseagle-sweat_shop-1.0.0 test/test_helper.rb
famoseagle-sweat_shop-1.1.0 test/test_helper.rb
famoseagle-sweat_shop-1.2.0 test/test_helper.rb
famoseagle-sweat_shop-1.3.0 test/test_helper.rb
famoseagle-sweat_shop-1.3.1 test/test_helper.rb
netinlet-sweat_shop-1.1.0 test/test_helper.rb
netinlet-sweat_shop-1.1.1 test/test_helper.rb