Class: EventMachine::Ventually::Eventually::TestUnit

Inherits:
EventMachine::Ventually::Eventually show all
Defined in:
lib/em-ventually/eventually/testunit.rb

Instance Attribute Summary

Attributes inherited from EventMachine::Ventually::Eventually

#expectation

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from EventMachine::Ventually::Eventually

#formatted_message, #initialize, #kill_timer, #process_test, #run, #stop, #test

Constructor Details

This class inherits a constructor from EventMachine::Ventually::Eventually

Class Method Details

.injectObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/em-ventually/eventually/testunit.rb', line 5

def self.inject
  unless ::Test::Unit::TestCase.public_method_defined?(:_em)
    ::Test::Unit::TestCase.class_eval "    include EM::Ventually::Emify\n    alias_method :__original__send__, :__send__\n    old_warning_level = $VERBOSE\n    $VERBOSE = nil\n    def __send__(*args, &blk)\n      if Callsite.parse(caller.first).method == 'run'\n        _em { __original__send__(*args, &blk) }\n      else\n        __original__send__(*args, &blk)\n      end\n    end\n    $VERBOSE = old_warning_level\n    EOT\n  end\nend\n", __FILE__, __LINE__ + 1

Instance Method Details

#assert_test(result) ⇒ Object



28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/em-ventually/eventually/testunit.rb', line 28

def assert_test(result)
  e = expectation
  if super
    msg = formatted_message("#{result.inspect} passed")
    @runner.instance_eval do
      assert true, msg
    end
    true
  else
    false
  end
end

#report(msg) ⇒ Object



24
25
26
# File 'lib/em-ventually/eventually/testunit.rb', line 24

def report(msg)
  @runner.assert false, msg
end