@@ -311,6 +311,12 @@ def test_do_classes_struct
311
311
312
312
klass = util_get_class content , 'cFoo'
313
313
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
314
320
end
315
321
316
322
def test_do_classes_struct_under
@@ -326,6 +332,12 @@ def test_do_classes_struct_under
326
332
klass = util_get_class content , 'cFoo'
327
333
assert_equal 'Kernel::Foo' , klass . full_name
328
334
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
329
341
end
330
342
331
343
def test_do_classes_struct_without_accessor
@@ -340,6 +352,7 @@ def test_do_classes_struct_without_accessor
340
352
341
353
klass = util_get_class content , 'cFoo'
342
354
assert_equal "this is the Foo class" , klass . comment . text
355
+ assert_empty klass . attributes
343
356
end
344
357
345
358
def test_do_classes_struct_without_accessor_under
@@ -355,6 +368,7 @@ def test_do_classes_struct_without_accessor_under
355
368
klass = util_get_class content , 'cFoo'
356
369
assert_equal 'Kernel::Foo' , klass . full_name
357
370
assert_equal "this is the Foo class under Kernel" , klass . comment . text
371
+ assert_empty klass . attributes
358
372
end
359
373
360
374
def test_do_classes_class_under
0 commit comments