summaryrefslogtreecommitdiff
blob: 95adfd1df319f74949e8cdb7fd99557d5d9e0782 (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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
commit 2d606b3ca1378edf1c42ad58877c9bdaabf79480
Author: Eric Hodel <drbrain@segment7.net>
Date:   Sun Mar 11 18:00:21 2012 -0700

    Fix hash-order-dependent tests

diff --git a/lib/rdoc/ri/driver.rb b/lib/rdoc/ri/driver.rb
index a3ca813..149a808 100644
--- a/lib/rdoc/ri/driver.rb
+++ b/lib/rdoc/ri/driver.rb
@@ -723,7 +723,7 @@ Options may also be set in the 'RI' environment variable.
     page do |io|
       io.puts "#{name} not found, maybe you meant:"
       io.puts
-      io.puts matches.join("\n")
+      io.puts matches.sort.join("\n")
     end
 
     false
diff --git a/test/test_rdoc_context.rb b/test/test_rdoc_context.rb
index 192a287..52f579c 100644
--- a/test/test_rdoc_context.rb
+++ b/test/test_rdoc_context.rb
@@ -340,7 +340,7 @@ class TestRDocContext < XrefTestCase
 
   def test_classes
     assert_equal %w[C2::C3], @c2.classes.map { |k| k.full_name }
-    assert_equal %w[C3::H1 C3::H2], @c3.classes.map { |k| k.full_name }
+    assert_equal %w[C3::H1 C3::H2], @c3.classes.map { |k| k.full_name }.sort
   end
 
   def test_current_section
diff --git a/test/test_rdoc_parser_ruby.rb b/test/test_rdoc_parser_ruby.rb
index 1ff6f4d..18964f9 100644
--- a/test/test_rdoc_parser_ruby.rb
+++ b/test/test_rdoc_parser_ruby.rb
@@ -701,7 +701,7 @@ end
 
     @parser.parse_class @top_level, false, @parser.get_tk, @comment
 
-    assert_equal %w[A B],    RDoc::TopLevel.classes.map { |c| c.full_name }
+    assert_equal %w[A B], RDoc::TopLevel.classes.map { |c| c.full_name }.sort
   end
 
   def test_parse_class_single
@@ -720,10 +720,12 @@ end
 
     @parser.parse_class @top_level, false, @parser.get_tk, @comment
 
-    assert_equal %w[A],    RDoc::TopLevel.classes.map { |c| c.full_name }
-    assert_equal %w[A::B A::d], RDoc::TopLevel.modules.map { |c| c.full_name }
+    assert_equal %w[A], RDoc::TopLevel.classes.map { |c| c.full_name }
 
-    b = RDoc::TopLevel.modules.first
+    modules = RDoc::TopLevel.modules.sort_by { |c| c.full_name }
+    assert_equal %w[A::B A::d], modules.map { |c| c.full_name }
+
+    b = modules.first
     assert_equal 10, b.offset
     assert_equal 2,  b.line
 
@@ -1851,10 +1853,10 @@ end
 
     @parser.parse_statements @top_level
 
-    date, date_time = @top_level.classes
+    date, date_time = @top_level.classes.sort_by { |c| c.full_name }
 
     date_now      = date.method_list.first
-    date_time_now = date_time.method_list.first
+    date_time_now = date_time.method_list.sort_by { |m| m.full_name }.first
 
     assert_equal :private, date_now.visibility
     assert_equal :public,  date_time_now.visibility
@@ -1876,10 +1878,11 @@ end
 
     @parser.parse_statements @top_level
 
-    date, date_time = @top_level.classes
+    # TODO sort classes by default
+    date, date_time = @top_level.classes.sort_by { |c| c.full_name }
 
     date_now      = date.method_list.first
-    date_time_now = date_time.method_list.first
+    date_time_now = date_time.method_list.sort_by { |m| m.full_name }.first
 
     assert_equal :public,  date_now.visibility,      date_now.full_name
     assert_equal :private, date_time_now.visibility, date_time_now.full_name