File tree 4 files changed +39
-0
lines changed
4 files changed +39
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,29 @@ MooseAbstractGroupTest >> testWithIndexDo [
494
494
self assertCollection: t hasSameElements: {{el1 . 1 } . {el2 . 2 } . {el3 . 3 }}
495
495
]
496
496
497
+ { #category : #tests }
498
+ MooseAbstractGroupTest >> testWithoutStubs [
499
+
500
+ | stubEntity1 stubEntity2 |
501
+
502
+ stubEntity1 := MooseEntity new
503
+ isStub: true ;
504
+ yourself .
505
+ stubEntity2 := MooseEntity new
506
+ isStub: true ;
507
+ yourself .
508
+ group
509
+ add: MooseEntity new ;
510
+ add: MooseEntity new ;
511
+ add: stubEntity1;
512
+ add: stubEntity2.
513
+
514
+ self assert: group size equals: 4 .
515
+ self assert: group withoutStubs isMooseObject.
516
+ self assert: group withoutStubs size equals: 2 .
517
+ group withoutStubs do: [ :entity | self deny: entity isStub ]
518
+ ]
519
+
497
520
{ #category : #utilities }
498
521
MooseAbstractGroupTest >> twoClasses [
499
522
| classA classB |
Original file line number Diff line number Diff line change @@ -786,6 +786,12 @@ MooseAbstractGroup >> withIndexDo: aBlockClosure [
786
786
self entities withIndexDo: aBlockClosure
787
787
]
788
788
789
+ { #category : #accessing }
790
+ MooseAbstractGroup >> withoutStubs [
791
+
792
+ ^ (self reject: #isStub ) asMooseGroup
793
+ ]
794
+
789
795
{ #category : #' set operations' }
790
796
MooseAbstractGroup >> | aCollection [
791
797
^ self union: aCollection
Original file line number Diff line number Diff line change @@ -358,6 +358,11 @@ MooseObject >> isMooseModel [
358
358
^ false
359
359
]
360
360
361
+ { #category : #testing }
362
+ MooseObject >> isMooseObject [
363
+ ^ true
364
+ ]
365
+
361
366
{ #category : #testing }
362
367
MooseObject >> isOfType: aClassFAMIX [
363
368
^ self class isOfType: aClassFAMIX
Original file line number Diff line number Diff line change @@ -29,6 +29,11 @@ Object >> isMooseEntity [
29
29
^ false
30
30
]
31
31
32
+ { #category : #' *Moose-Core' }
33
+ Object >> isMooseObject [
34
+ ^ false
35
+ ]
36
+
32
37
{ #category : #' *Moose-Core' }
33
38
Object class >> isOfType: aClassFAMIX [
34
39
^ false
You can’t perform that action at this time.
0 commit comments