From 8b83efd963a4c6994317ca57ae3af8d4fccdd33f Mon Sep 17 00:00:00 2001 From: Esteban Maringolo Date: Wed, 8 Jan 2025 14:57:06 -0300 Subject: [PATCH] Fixes #141 --- source/.configmaps | 16 +++++------ .../TonelWriterMethodDefinition.class.st | 2 +- .../Object.extension.st | 2 +- .../TonelMethodWriterTest.class.st | 27 +++++++++++++++++++ source/TonelWriterTests/TonelMockA.class.st | 2 +- 5 files changed, 38 insertions(+), 11 deletions(-) diff --git a/source/.configmaps b/source/.configmaps index 2761419..2d5713a 100644 --- a/source/.configmaps +++ b/source/.configmaps @@ -1,7 +1,7 @@ [ { #conditions : [ ], - #ts : 3912053785, + #ts : 3913800832, #comment : '', #formatVersion : '1.1', #applications : OrderedCollection [ @@ -37,16 +37,16 @@ }, { #name : 'TonelWriterModel', - #versionName : 'ae2f5a2-master + 140', - #ts : 3912052700 + #versionName : '8f3f990-master + 141', + #ts : 3913715428 } ], #name : 'ENVY/Image Tonel', - #versionName : 'ae2f5a2-master + 134, 135, 137, 138, 139, 140' + #versionName : '8f3f990-master + 141 a' }, { #conditions : [ ], - #ts : 3912053741, + #ts : 3913800868, #comment : '', #formatVersion : '1.1', #applications : OrderedCollection [ @@ -67,11 +67,11 @@ }, { #name : 'TonelWriterTests', - #versionName : 'ae2f5a2-master + 140', - #ts : 3912053677 + #versionName : '8f3f990-master + 141', + #ts : 3913800600 } ], #name : 'Test ENVY/Image Tonel', - #versionName : 'ae2f5a2-master + 134, 135, 137, 138, 139, 140' + #versionName : '8f3f990-master + 141 a' } ] \ No newline at end of file diff --git a/source/TonelWriterModel/TonelWriterMethodDefinition.class.st b/source/TonelWriterModel/TonelWriterMethodDefinition.class.st index 02e53b5..69c3512 100644 --- a/source/TonelWriterModel/TonelWriterMethodDefinition.class.st +++ b/source/TonelWriterModel/TonelWriterMethodDefinition.class.st @@ -39,7 +39,7 @@ TonelWriterMethodDefinition >> categoryFor: aTonelWriter [ "Answer the category used in a TonelWriter." ^(self isMonticelloExtension and: [aTonelWriter useMonticelloExtensions not]) - ifTrue: [self allCategories first] + ifTrue: [self allCategories asSortedCollection first] ifFalse: [self category] diff --git a/source/TonelWriterTestSubSubApp/Object.extension.st b/source/TonelWriterTestSubSubApp/Object.extension.st index 5e74d7c..128cadd 100644 --- a/source/TonelWriterTestSubSubApp/Object.extension.st +++ b/source/TonelWriterTestSubSubApp/Object.extension.st @@ -2,7 +2,7 @@ Extension { #name : 'Object' } -{ #category : 'Real Category', +{ #category : 'Another One', #vaCategories : ['Another One','Real Category'] } Object >> subSubExtensionForTest [ diff --git a/source/TonelWriterTests/TonelMethodWriterTest.class.st b/source/TonelWriterTests/TonelMethodWriterTest.class.st index 4c26698..faf1d01 100644 --- a/source/TonelWriterTests/TonelMethodWriterTest.class.st +++ b/source/TonelWriterTests/TonelMethodWriterTest.class.st @@ -207,6 +207,33 @@ TonelMockA >> withModeThanOneLine [ ' ] +{ #category : 'Test' } +TonelMethodWriterTest >> testWriteMethodWithMultipleCategories [ + + | definition stream | + + definition := + TonelWriterMethodDefinition + uniquelyKnownAs: #withMultipleCategories + in: TonelMockA + categorizedAs: 'Accessing'. + stream := self newStream. + writer write: definition on: stream. + self + assert: stream contents + isEqualSkippingSeparatorsTo: + ' +{ + #category : ''Accessing'', + #vaCategories : [''Accessing'',''Evaluating'',''Private''] +} +TonelMockA >> withMultipleCategories [ + + ^''withMultipleCategories'' +] +' +] + { #category : 'Test' } TonelMethodWriterTest >> testWritePrivateMethodDefinition [ diff --git a/source/TonelWriterTests/TonelMockA.class.st b/source/TonelWriterTests/TonelMockA.class.st index ff1bffd..350daa0 100644 --- a/source/TonelWriterTests/TonelMockA.class.st +++ b/source/TonelWriterTests/TonelMockA.class.st @@ -80,7 +80,7 @@ TonelMockA >> withModeThanOneLine [ #vaCategories : ['Accessing','Evaluating','Private'] } TonelMockA >> withMultipleCategories [ - ^ 'withMultipleCategories' + ^'withMultipleCategories' ] { #category : 'Accessing' }