Skip to content

Commit

Permalink
ring tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pavel-krivanek committed Aug 12, 2019
1 parent bd90463 commit 4c7925b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
4 changes: 2 additions & 2 deletions src/Ring-Core/RGReadOnlyImageBackend.class.st
Expand Up @@ -250,8 +250,8 @@ RGReadOnlyImageBackend >> metaclassFor: anRGBehavior [

{ #category : #'metaclass trait' }
RGReadOnlyImageBackend >> metaclassTraitBaseTraitFor: anRGMetaclassTrait [

^ (self realBehaviorFor: anRGMetaclassTrait) baseTrait asRingMinimalDefinitionIn: anRGMetaclassTrait environment.
^ (self realBehaviorFor: anRGMetaclassTrait) instanceSide
asRingMinimalDefinitionIn: anRGMetaclassTrait environment
]

{ #category : #method }
Expand Down
Expand Up @@ -26,8 +26,8 @@ RGClassDefinitionTest >> testAsClassDefinition3 [

newClass:= RGBehaviorDefinition asRingDefinitionWithMethods: false withSuperclasses: false withSubclasses: false withPackages: true.
newSlice := newClass environment.
self assert: (newClass package name = #'Ring-Deprecated-Core-Kernel').
self assert: (newSlice packageNamed: #'Ring-Deprecated-Core-Kernel') = newClass package.
self assert: (newClass package name = #'Ring-Definitions-Core').
self assert: (newSlice packageNamed: #'Ring-Definitions-Core') = newClass package.
self assert: (newClass package classes size = 1).
self assert: (newClass package classes values first = newClass).

Expand All @@ -36,7 +36,7 @@ RGClassDefinitionTest >> testAsClassDefinition3 [
self assert: (newClass package name = #Kernel).
self assert: (newClass extensionMethods notEmpty).
self assert: (newSlice methods size = (newClass methods size + newClass classSide methods size)).
self assert: (newSlice packageNamed: #'Ring-Deprecated-Core-Kernel') methods size > 1.
self assert: (newSlice packageNamed: #'Ring-Definitions-Core') methods size > 1.

]

Expand All @@ -51,7 +51,7 @@ RGClassDefinitionTest >> testAsFullClassDefinition [

rgClass := Class asFullRingDefinition.
self denyEmpty: rgClass methods.
self assert: (rgClass methodNamed: #asRingDefinition) package name = #'Ring-Deprecated-Core-Kernel'.
self assert: (rgClass methodNamed: #asRingDefinition) package name = #'Ring-Definitions-Core'.
self assert: rgClass superclass notNil.
self assert: rgClass superclass name = #ClassDescription.
self denyEmpty: rgClass subclasses.
Expand Down
Expand Up @@ -11,7 +11,7 @@ RGContainerTest >> testRetrievingPackages [
rgMethod := (RGMethodDefinition realClass: Class selector: #asRingDefinition).
rgMethod package: (RGContainer packageOfMethod: rgMethod).
self assert: rgMethod parent isNil.
self assert: rgMethod package name = #'Ring-Deprecated-Core-Kernel'.
self assert: rgMethod package name = #'Ring-Definitions-Core'.

rgMethod := (RGMethodDefinition realClass: OrderedCollection selector: #size).
rgMethod package: (RGContainer packageOfMethod: rgMethod).
Expand Down
Expand Up @@ -15,7 +15,7 @@ RGMethodDefinitionTest >> testAsFullMethodDefinition [
self assert: rgMethod parent methods size = 1.
self assert: rgMethod parent package name equals: #Kernel.
self assert: rgMethod package notNil.
self assert: rgMethod package name = #'Ring-Deprecated-Core-Kernel'.
self assert: rgMethod package name = #'Ring-Definitions-Core'.

"retrieves package information from class package name "
rgMethod := (Class >> #name) asFullRingDefinition.
Expand Down
8 changes: 4 additions & 4 deletions src/Ring-Tests-Core/RGReadOnlyImageBackendTest.class.st
Expand Up @@ -98,13 +98,13 @@ RGReadOnlyImageBackendTest >> testClassTrait [
self assert: classTrait isMeta.
self assert: classTrait name equals: 'RGTestTrait classTrait'.
self assert: classTrait baseTrait name equals: 'RGTestTrait'.
self assert: classTrait category equals: 'Ring2-Tests-Core'.
self assert: classTrait category equals: 'Ring-Tests-Core'.
self assert: classTrait superclass name equals: #Trait.
self assert: classTrait comment content equals: RGTestTrait organization comment.
self assert: classTrait localMethods size equals: RGTestTrait classTrait localMethods size.
self assert: classTrait protocols asSortedCollection equals: RGTestTrait classTrait protocols asSortedCollection.
self assert: classTrait metaclass name equals: #MetaclassForTraits.
self assert: classTrait package name equals: 'Ring2-Tests-Core'.
self assert: classTrait package name equals: 'Ring-Tests-Core'.


]
Expand Down Expand Up @@ -307,14 +307,14 @@ RGReadOnlyImageBackendTest >> testTrait [
self assert: trait isMeta not.
self assert: trait name equals: #RGTestTrait.
self assert: trait classTrait name equals: 'RGTestTrait classTrait'.
self assert: trait category equals: 'Ring2-Tests-Core'.
self assert: trait category equals: 'Ring-Tests-Core'.
self assert: (trait superclass == trait). "cycle, nil in reality"
self assert: trait comment content equals: RGTestTrait organization comment.
self assert: trait localMethods size equals: RGTestTrait localMethods size.
self assert: trait protocols asSortedCollection equals: RGTestTrait protocols asSortedCollection.
self assert: trait metaclass name equals: 'RGTestTrait classTrait'.
self assert: trait metaclass superclass name equals: 'Trait'.
self assert: trait package name equals: 'Ring2-Tests-Core'.
self assert: trait package name equals: 'Ring-Tests-Core'.


]
Expand Down
4 changes: 2 additions & 2 deletions src/Ring-Tests-Monticello/RGMCClassTest.class.st
Expand Up @@ -30,7 +30,7 @@ RGMCClassTest >> testNormalKernelClasses [

"classes without special slots"

(#Kernel asPackage definedClasses select: [:each | each isClass and: [each usesSpecialVariables not]]) do: [ :each |
(#Kernel asPackage definedClasses select: [:each | each isClass and: [each needsSlotClassDefinition not]]) do: [ :each |
self testClass: each].
]

Expand All @@ -39,6 +39,6 @@ RGMCClassTest >> testSpecialClasses [

"classes without special slots"

(#Kernel asPackage definedClasses select: [:each | each isClass and: [each usesSpecialVariables]]) do: [ :each |
(#Kernel asPackage definedClasses select: [:each | each isClass and: [each needsSlotClassDefinition]]) do: [ :each |
self testClass: each].
]

0 comments on commit 4c7925b

Please sign in to comment.