@@ -311,6 +311,12 @@ def test_do_classes_struct
311311
312312 klass = util_get_class content , 'cFoo'
313313 assert_equal "this is the Foo class" , klass . comment . text
314+
315+ attributes = klass . attributes
316+ assert_equal 3 , attributes . size , -> { attributes }
317+ [ "some" , "various" , "fields" ] . zip ( attributes ) do |name , attr |
318+ assert_equal RDoc ::Attr . new ( "" , name , "RW" , "" ) , attr
319+ end
314320 end
315321
316322 def test_do_classes_struct_under
@@ -326,6 +332,12 @@ def test_do_classes_struct_under
326332 klass = util_get_class content , 'cFoo'
327333 assert_equal 'Kernel::Foo' , klass . full_name
328334 assert_equal "this is the Foo class under Kernel" , klass . comment . text
335+
336+ attributes = klass . attributes
337+ assert_equal 3 , attributes . size , -> { attributes }
338+ [ "some" , "various" , "fields" ] . zip ( attributes ) do |name , attr |
339+ assert_equal RDoc ::Attr . new ( "" , name , "RW" , "" ) , attr
340+ end
329341 end
330342
331343 def test_do_classes_struct_without_accessor
@@ -340,6 +352,7 @@ def test_do_classes_struct_without_accessor
340352
341353 klass = util_get_class content , 'cFoo'
342354 assert_equal "this is the Foo class" , klass . comment . text
355+ assert_empty klass . attributes
343356 end
344357
345358 def test_do_classes_struct_without_accessor_under
@@ -355,6 +368,7 @@ def test_do_classes_struct_without_accessor_under
355368 klass = util_get_class content , 'cFoo'
356369 assert_equal 'Kernel::Foo' , klass . full_name
357370 assert_equal "this is the Foo class under Kernel" , klass . comment . text
371+ assert_empty klass . attributes
358372 end
359373
360374 def test_do_classes_class_under
0 commit comments