Sha256: 19abb1814fc3bea35f902a7d81be5f5c64a1a1d7f50cc0458241942886abbdeb

Contents?: true

Size: 442 Bytes

Versions: 48

Compression:

Stored size: 442 Bytes

Contents

require 'test/unit'

class Test::Unit::TestCase
  
  def self.test(name, &block)
    test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
    defined = instance_method(test_name) rescue false
    raise "#{test_name} is already defined in #{self}" if defined
    if block_given?
      define_method(test_name, &block)
    else
      define_method(test_name) do
        flunk "No implementation provided for #{name}"
      end
    end
  end
  
end

Version data entries

48 entries across 48 versions & 3 rubygems

Version Path
mwmitchell-rsolr-ext-0.4.0 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.4.1 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.0 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.1 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.2 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.3 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.4 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.5 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.6 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.7 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.8 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.9 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.5.95 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.6.0 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.6.1 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.7.0 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.7.1 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.7.10 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.7.11 test/test_unit_test_case.rb
mwmitchell-rsolr-ext-0.7.12 test/test_unit_test_case.rb