generated from hpi-swa-teaching/SWT-Demo
-
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.
refactored board saver to use instances
- Loading branch information
Showing
21 changed files
with
47 additions
and
32 deletions.
There are no files selected for viewing
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
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,4 +1,4 @@ | ||
updating | ||
saveBoard | ||
|
||
SPBBoardSaver save: self as: self boardProvider repo. | ||
SPBBoardSaver defaultSaver save: self as: self boardProvider repo. |
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
5 changes: 5 additions & 0 deletions
5
Squello-Core.package/SPBBoardSaver.class/class/defaultSaver.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 @@ | ||
singleton | ||
defaultSaver | ||
|
||
instance ifNil: [instance := SPBBoardSaver new]. | ||
^ instance. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
14 changes: 7 additions & 7 deletions
14
Squello-Core.package/SPBBoardSaver.class/methodProperties.json
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,10 +1,10 @@ | ||
{ | ||
"class" : { | ||
"boards" : "FP 5/27/2024 15:39", | ||
"boards:" : "FP 5/27/2024 15:39", | ||
"clear" : "FP 5/27/2024 17:17", | ||
"delete:" : "FP 5/27/2024 16:21", | ||
"load:" : "FP 5/27/2024 16:18", | ||
"save:as:" : "FP 5/27/2024 16:15" }, | ||
"defaultSaver" : "FP 6/3/2024 11:17" }, | ||
"instance" : { | ||
} } | ||
"boards" : "FP 6/3/2024 11:15", | ||
"boards:" : "FP 6/3/2024 11:15", | ||
"clear" : "FP 6/3/2024 11:15", | ||
"delete:" : "FP 6/3/2024 11:15", | ||
"load:" : "FP 6/3/2024 11:15", | ||
"save:as:" : "FP 6/3/2024 11:15" } } |
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
2 changes: 1 addition & 1 deletion
2
Squello-Tests.package/SPBLocalSaveTests.class/instance/setUp.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,4 +1,4 @@ | ||
setup | ||
setUp | ||
|
||
SPBBoardSaver delete: self defaultKey. | ||
saver := SPBBoardSaver new. |
4 changes: 2 additions & 2 deletions
4
Squello-Tests.package/SPBLocalSaveTests.class/instance/tearDown.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,4 +1,4 @@ | ||
setup | ||
tearDown | ||
|
||
SPBBoardSaver delete: self defaultKey. | ||
saver := nil. |
8 changes: 8 additions & 0 deletions
8
Squello-Tests.package/SPBLocalSaveTests.class/instance/testClear.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,8 @@ | ||
tests | ||
testClear | ||
|
||
| loadedValue | | ||
saver save: self defaultValue as: self defaultKey. | ||
saver clear. | ||
loadedValue := saver load: self defaultKey. | ||
self assert: loadedValue isNil. |
5 changes: 3 additions & 2 deletions
5
Squello-Tests.package/SPBLocalSaveTests.class/instance/testDeleteReturnsNil.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,7 +1,8 @@ | ||
tests | ||
testDeleteReturnsNil | ||
"the delete happens in setUp" | ||
|
||
| loadedValue | | ||
loadedValue := SPBBoardSaver load: self defaultKey. | ||
saver save: self defaultValue as: self defaultKey. | ||
saver delete: self defaultKey. | ||
loadedValue := saver load: self defaultKey. | ||
self assert: loadedValue isNil. |
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
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
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
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
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 |
---|---|---|
|
@@ -6,7 +6,7 @@ | |
], | ||
"commentStamp" : "", | ||
"instvars" : [ | ||
], | ||
"saver" ], | ||
"name" : "SPBLocalSaveTests", | ||
"pools" : [ | ||
], | ||
|