Class: Test::Unit::TestCase

Inherits:
Object
  • Object
show all
Defined in:
lib/orb/drivers/test-unit.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.orb!Object



4
5
6
# File 'lib/orb/drivers/test-unit.rb', line 4

def self.orb!
  define_method("test_orb_#{rand 100000}") { orb!(self) }
end

Instance Method Details

#orb!(ctx) ⇒ Object



8
9
10
# File 'lib/orb/drivers/test-unit.rb', line 8

def orb!(ctx)
  with_immediate_asserts(ctx) { Orb::Runner.new(ctx).run }
end

#with_immediate_asserts(ctx) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/orb/drivers/test-unit.rb', line 12

def with_immediate_asserts(ctx)
  class << self
    alias_method :_original_wrap_assertion, :_wrap_assertion
    def _wrap_assertion ; yield ; end
  end

  yield

  class << self
    alias_method :_wrap_assertion, :_original_wrap_assertion
  end
end