Skip to content
Browse files

Fixed order-dependent RDoc::Store tests

  • Loading branch information...
1 parent 239d9bb commit c8f0298345ff9672fd53fa8c841bad633edc62fc @drbrain drbrain committed
Showing with 8 additions and 12 deletions.
  1. +4 −7 lib/rdoc/top_level.rb
  2. +4 −5 test/test_rdoc_store.rb
View
11 lib/rdoc/top_level.rb
@@ -198,15 +198,12 @@ def marshal_dump
# Loads this TopLevel from +array+.
def marshal_load array # :nodoc:
- @name = nil
- @relative_name = array[1]
- @absolute_name = array[1]
- @parser = array[2]
- @comment = array[3]
+ initialize array[1]
+
+ @parser = array[2]
+ @comment = array[3]
@file_stat = nil
- @diagram = nil
- @classes_or_modules = []
end
##
View
9 test/test_rdoc_store.rb
@@ -268,15 +268,15 @@ def test_load_all
s.load_all
- assert_equal [@klass, @nest_klass], s.all_classes
- assert_equal [@mod], s.all_modules
- assert_equal [@top_level, @page], s.all_files
+ assert_equal [@klass, @nest_klass], s.all_classes.sort
+ assert_equal [@mod], s.all_modules.sort
+ assert_equal [@page, @top_level], s.all_files.sort
methods = s.all_classes_and_modules.map do |mod|
mod.method_list
end.flatten.sort
- assert_equal [@cmeth, @meth, @nest_meth, @meth_bang], methods
+ assert_equal [@cmeth, @meth, @nest_meth, @meth_bang], methods.sort
method = methods.find { |m| m == @meth }
assert_equal @meth_comment.parse, method.comment
@@ -414,7 +414,6 @@ def test_save
expected = {
:ancestors => {
- 'Object' => OBJECT_ANCESTORS,
'Object::SubClass' => %w[Incl Object],
},
:attributes => { 'Object' => ['attr_accessor attr'] },

0 comments on commit c8f0298

Please sign in to comment.
Something went wrong with that request. Please try again.