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
53 class FakeBehavior < Behavior
64 class FakeContact < Contact
78 self.pid_file_directory = nil
84 old_verbose, $VERBOSE = $VERBOSE, nil
87 $VERBOSE = old_verbose
91 old_stdout = $stdout.dup
92 $stdout.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
94 $stdout.reopen(old_stdout)
98 old_stderr = $stderr.dup
99 $stderr.reopen(File.open((PLATFORM =~ /mswin/ ? "NUL" : "/dev/null"), 'w'))
101 $stderr.reopen(old_stderr)
113 module Test::Unit::Assertions
115 assert_raise SystemExit do
121 # This allows you to be a good OOP citizen and honor encapsulation, but
122 # still make calls to private methods (for testing) by doing
124 # obj.bypass.private_thingie(arg1, arg2)
126 # Which is easier on the eye than
128 # obj.send(:private_thingie, arg1, arg2)
132 instance_methods.each do |m|
133 undef_method m unless m =~ /^__/
140 def method_missing(sym, *args)
141 @ref.__send__(sym, *args)