Sha256: 999f48aac6bb38486da2c6179778dd744cabdb08472ffdb56485ad4241952582

Contents?: true

Size: 597 Bytes

Versions: 3

Compression:

Stored size: 597 Bytes

Contents

module Test::Unit
  # Used to fix a minor minitest/unit incompatibility in flexmock
  AssertionFailedError = Class.new(StandardError)
  
  class 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
end

Version data entries

3 entries across 3 versions & 3 rubygems

Version Path
koi-reference-parser-0.0.1 test/setup/test_unit_extensions.rb
ruby-tmdb-0.1.3 test/setup/test_unit_extensions.rb
deepopenstruct-0.1.2 test/setup/test_unit_extensions.rb