1 require File.join(File.dirname(__FILE__), *%w[.. lib god])
8 if RUBY_PLATFORM =~ /linux/i && Process.uid != 0
10 *********************************************************************
12 * You need to run these tests as root (netlink requires it) *
14 *********************************************************************
26 abort "=> You need the Mocha gem to run these tests."
32 class FakeCondition < Condition
38 class FakePollCondition < PollCondition
44 class FakeEventCondition < EventCondition
52 class FakeBehavior < Behavior
57 alias :at_exit_orig :at_exit
71 self.pid_file_directory = nil
77 old_verbose, $VERBOSE = $VERBOSE, nil
80 $VERBOSE = old_verbose
84 old_stdout = $stdout.dup
85 $stdout.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
87 $stdout.reopen(old_stdout)
91 old_stderr = $stderr.dup
92 $stderr.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
94 $stderr.reopen(old_stderr)
103 module Test::Unit::Assertions
105 assert_raise SystemExit do
113 # This allows you to be a good OOP citizen and honor encapsulation, but
114 # still make calls to private methods (for testing) by doing
116 # obj.bypass.private_thingie(arg1, arg2)
118 # Which is easier on the eye than
120 # obj.send(:private_thingie, arg1, arg2)
124 instance_methods.each do |m|
125 undef_method m unless m =~ /^__/
132 def method_missing(sym, *args)
133 @ref.__send__(sym, *args)