Fix compiler warning due to missing function prototype.
[svn.git] / subversion / bindings / swig / ruby / test / my-assertions.rb
blob211b224b6126ae7629cb9cccbd3fc0109f77fc6a
1 require "test/unit"
2 require "test/unit/assertions"
4 module Test
5   module Unit
6     module Assertions
8       def assert_true(boolean, message=nil)
9         _wrap_assertion do
10           assert_equal(true, boolean, message)
11         end
12       end
14       def assert_false(boolean, message=nil)
15         _wrap_assertion do
16           assert_equal(false, boolean, message)
17         end
18       end
20       def assert_nested_sorted_array(expected, actual, message=nil)
21         _wrap_assertion do
22           assert_equal(expected.collect {|elem| elem.sort},
23                        actual.collect {|elem| elem.sort},
24                        message)
25         end
26       end
28       def assert_equal_log_entries(expected, actual, message=nil)
29         _wrap_assertion do
30           actual = actual.collect do |entry|
31             changed_paths = entry.changed_paths
32             changed_paths.each_key do |path|
33               changed_path = changed_paths[path]
34               changed_paths[path] = [changed_path.action,
35                                      changed_path.copyfrom_path,
36                                      changed_path.copyfrom_rev]
37             end
38             [changed_paths,
39              entry.revision,
40              entry.revision_properties.reject {|key, value| key == "svn:date"},
41              entry.has_children?]
42           end
43           assert_equal(expected, actual, message)
44         end
45       end
46     end
47   end
48 end