Sha256: 9749a9479e3fd651f537b1f089f7aa4c3654704812209ff0a9c5c16a2d3e6ed6
Contents?: true
Size: 701 Bytes
Versions: 6
Compression:
Stored size: 701 Bytes
Contents
require 'simplecov' SimpleCov.start do add_filter "/test" end require 'test/unit' require 'rspec/expectations' require 'test/unit/given' class BaseTest < Test::Unit::Given::TestCase # Copied from Rails; makes a test method using a string 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 raise "No implementation provided for #{name}" end end end def test_nothing # Seems 1.8 wants to have a test here? end end
Version data entries
6 entries across 6 versions & 1 rubygems