Skip to content

Commit

Permalink
Fix #1315: View Composer cannot save new view (#1316)
Browse files Browse the repository at this point in the history
  • Loading branch information
blairmcg authored Dec 29, 2024
1 parent 19615c6 commit 015dbba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Core/Object Arts/Dolphin/Base/UI.ResourceIdentifier.cls
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ class: aClass name: aString
yourself!

class: aClass selector: aSymbol
(aSymbol beginsWith: SelectorPrefix)
(aSymbol isNil or: [aSymbol beginsWith: SelectorPrefix])
ifFalse: [self error: 'Invalid resource selector ' , aSymbol printString].
^self newClass: aClass selector: aSymbol!

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,23 @@ testAssignResource
[self class class removeSelector: #resource_Test_view ifAbsent: nil.
self assert: (self class respondsTo: #resource_Test_view) not]!

testCopy
| subject copy |
subject := ResourceIdentifier class: Shell name: Shell defaultView.
copy := subject copy.
self assert: copy equals: subject.
self deny: copy identicalTo: subject.
self assert: copy owningClass identicalTo: subject owningClass.
self assert: copy selector identicalTo: subject selector.
subject name: nil.
self assertIsNil: subject selector.
self assert: subject printString equals: 'Shell.untitled'.
copy := subject copy.
self assert: copy equals: subject.
self deny: copy identicalTo: subject.
self assert: copy owningClass identicalTo: subject owningClass.
self assert: copy selector identicalTo: subject selector!

testDeserializeAll
"Test's that all view resources are deserializable. The most common cause of breakage would
be changing the layout of a class with serialized instances in resources without adding an
Expand Down Expand Up @@ -119,6 +136,7 @@ createResourceNamed:for:on:!helpers!private! !
setUp!private!unit tests! !
tempViewResource!private!unit tests! !
testAssignResource!public!unit tests! !
testCopy!public!unit tests! !
testDeserializeAll!public!unit tests! !
testReferenceToNonExistentView!public!unit tests! !
testResourceSelector!public!unit tests! !
Expand Down

0 comments on commit 015dbba

Please sign in to comment.