Class: EventMachine::Ventually::Eventually::MiniTest
Instance Attribute Summary
#expectation
Class Method Summary
collapse
Instance Method Summary
collapse
#formatted_message, #initialize, #kill_timer, #process_test, #run, #stop, #test
Class Method Details
.inject ⇒ Object
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'lib/em-ventually/eventually/minitest.rb', line 5
def self.inject
unless ::MiniTest::Unit::TestCase.public_method_defined?(:_em)
::MiniTest::Unit::TestCase.class_eval <<-EOT, __FILE__, __LINE__ + 1
include EM::Ventually::Emify
alias_method :__original__send__, :__send__
old_warning_level = $VERBOSE
$VERBOSE = nil
def __send__(*args, &blk)
if Callsite.parse(caller.first).method == 'run'
_em { __original__send__(*args, &blk) }
else
__original__send__(*args, &blk)
end
end
$VERBOSE = old_warning_level
EOT
end
end
|
Instance Method Details
#assert_test(result) ⇒ Object
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'lib/em-ventually/eventually/minitest.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/minitest.rb', line 24
def report(msg)
@runner.assert false, msg
end
|