forked from magritte-metamodel/magritte
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #12 - Default Label Enhancements
- Avoid Nil Test - Pass Description as Argument to Accessor - Add test for default/auto labels
- Loading branch information
1 parent
0112312
commit 2a607e9
Showing
5 changed files
with
10 additions
and
5 deletions.
There are no files selected for viewing
3 changes: 0 additions & 3 deletions
3
source/Magritte-Model.package/MAAccessor.class/instance/defaultLabel.st
This file was deleted.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
source/Magritte-Model.package/MAAccessor.class/instance/defaultLabelFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
accessing | ||
defaultLabelFor: aDescription | ||
^ aDescription class defaultLabel |
2 changes: 1 addition & 1 deletion
2
source/Magritte-Model.package/MADescription.class/instance/defaultLabel.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
acessing-magritte | ||
defaultLabel | ||
^ self accessor defaultLabel ifNil: [ self class defaultLabel ] | ||
^ self accessor defaultLabelFor: self |
2 changes: 1 addition & 1 deletion
2
...orAccessor.class/instance/defaultLabel.st → ...cessor.class/instance/defaultLabelFor..st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
accessing | ||
defaultLabel | ||
defaultLabelFor: aDescription | ||
^ self readSelector normalizeCamelCase capitalized |
5 changes: 5 additions & 0 deletions
5
source/Magritte-Tests-Model.package/MADescriptionTest.class/instance/testDefaultLabel.st
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
tests-accessing | ||
testDefaultLabel | ||
self assert: self description label = ''. | ||
self description accessor: #foo. | ||
self assert: self description label = 'Foo' |