Sha256: 189b8ea4ea846529dbce2a6183b1731f1419692634130ac6f1fc9e70b731e706

Contents?: true

Size: 513 Bytes

Versions: 3

Compression:

Stored size: 513 Bytes

Contents

require 'minitest'
require "minitest/autorun"

require 'mocha/setup'
require 'test_construct'

class Minitest::Test

  def self.testing(name)
    @group = name
    yield
    @group = nil
  end

  def self.test(name, &block)
    name = name.strip.gsub(/\s\s+/, " ")
    group = "#{@group}: " if @group
    test_name = "test_: #{group}#{name}".to_sym
    defined = instance_methods.include? test_name
    raise "#{test_name} is already defined in #{self}" if defined
    define_method(test_name, &block)
  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
test_construct-2.0.1 test/test_helper.rb
test_construct-2.0.0 test/test_helper.rb
test_construct-1.0.0 test/test_helper.rb