1 require File.join(File.dirname(__FILE__), *%w[.. lib god])
14 abort "=> You need the Mocha gem to run these tests."
22 class FakeCondition < Condition
28 class FakePollCondition < PollCondition
34 class FakeEventCondition < EventCondition
42 class FakeBehavior < Behavior
47 alias :at_exit_orig :at_exit
61 self.pid_file_directory = nil
67 old_verbose, $VERBOSE = $VERBOSE, nil
70 $VERBOSE = old_verbose
74 old_stdout = $stdout.dup
75 $stdout.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
77 $stdout.reopen(old_stdout)
81 old_stderr = $stderr.dup
82 $stderr.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
84 $stderr.reopen(old_stderr)
87 module Test::Unit::Assertions
89 assert_raise SystemExit do
97 # This allows you to be a good OOP citizen and honor encapsulation, but
98 # still make calls to private methods (for testing) by doing
100 # obj.bypass.private_thingie(arg1, arg2)
102 # Which is easier on the eye than
104 # obj.send(:private_thingie, arg1, arg2)
108 instance_methods.each do |m|
109 undef_method m unless m =~ /^__/
116 def method_missing(sym, *args)
117 @ref.__send__(sym, *args)