summaryrefslogtreecommitdiffstats
path: root/tests/runit_.rb
blob: 0479592542803cdbf9ed44853df5528f93b5d2e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
begin
   require 'test/unit'
rescue LoadError
   require 'runit/testcase'
   require 'runit/cui/testrunner'

   module RUNIT
      module Assert
	 def assert_raises(error, message = nil)
	    begin
	       yield
	    rescue error
	       assert(true, message)
	    rescue
	       assert_fail("must fail with #{error} : #{string}")
	    else
	       assert_fail("*must* fail : #{string}")
	    end
	 end
	 def flunk(message = "")
	    assert_fail(message)
	 end
      end
   end
end


if RUBY_VERSION > "1.7"
   class Array
      alias indices select
   end
   class Hash
      alias indexes select
   end
   module BDB
      class Common
	 alias indexes select
      end

      class Recnum
	 alias indices select
      end
   end
end