Class: Test::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/nest-unit.rb

Defined Under Namespace

Classes: Context

Class Method Summary collapse

Class Method Details

.context(name = nil, &block) ⇒ Object



59
60
61
# File 'lib/nest-unit.rb', line 59

def self.context(name=nil, &block)
  Context.new(self, name).instance_eval(&block)
end

.test(name, &block) ⇒ Object



4
5
6
# File 'lib/nest-unit.rb', line 4

def self.test(name, &block)
  define_method("test_" + name.gsub(/[^\w]/, '_'), &block)
end