Skip to content

Commit

Permalink
Merge pull request #51 from hpi-swa-teaching/load_json_fix
Browse files Browse the repository at this point in the history
Load json fix
  • Loading branch information
fhradilak committed Jun 1, 2021
2 parents b6f0b67 + cbc90e2 commit 19995f5
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 18 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/smalltalk-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ jobs:
os: [ ubuntu-latest, macos-latest, windows-latest ]
smalltalk:
- Squeak64-5.3
- Squeak64-5.2
- Squeak64-5.1
- Squeak64-trunk
runs-on: ${{ matrix.os }}
name: ${{ matrix.smalltalk }} on ${{ matrix.os }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ createStartInformation: aMorph
with: #value -> aMorph rotationDegrees.
Dictionary
with: #name -> 'positionX'
with: #value -> aMorph x.
with: #value -> aMorph position x.
Dictionary
with: #name -> 'positionY'
with: #value -> aMorph y.
with: #value -> aMorph position y.
Dictionary
with: #name -> 'width'
with: #value -> aMorph width.
Expand All @@ -21,5 +21,5 @@ createStartInformation: aMorph
with: #value -> aMorph height.
Dictionary
with: #name -> 'color'
with: #value -> aMorph color rgbTriplet.
with: #value -> aMorph color printHtmlString asSymbol.
}.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
saveJson
outputFileDirectory
^ UIManager default saveFilenameRequest: 'Please, enter file name.' initialAnswer: 'animation'.
^ UIManager default saveFilenameRequest: 'Please, enter file name.' initialAnswer: 'animation.json'.


Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ saveJson
writeJsonToFile: aJsonString with: aDirectory
aDirectory
ifNotNil: [
FileDirectory default forceNewFileNamed: aDirectory, '.json' do: [:stream |
FileDirectory default forceNewFileNamed: aDirectory do: [:stream |
stream nextPutAll: aJsonString].
]
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"createPositionPropertyFrom:" : "DM 8/6/2020 10:09",
"createRotationPropertyFrom:" : "FH 5/13/2021 10:16",
"createSizePropertyFrom:" : "DM 7/8/2020 14:29",
"createStartInformation:" : "MH 5/20/2021 11:24",
"createStartInformation:" : "NB 5/27/2021 12:37",
"createStructure:with:" : "NB 5/13/2021 10:25",
"defaultEmptyPanels" : "DM 8/7/2020 17:37",
"defaultPropertyPanelPosition" : "DM 8/6/2020 10:38",
Expand Down Expand Up @@ -62,7 +62,7 @@
"mainWindow" : "JIZ 6/3/2020 17:04",
"mainWindow:" : "JIZ 6/3/2020 17:04",
"morphTypes" : "LW 5/15/2021 14:00",
"outputFileDirectory" : "NB 5/21/2021 09:07",
"outputFileDirectory" : "NB 5/27/2021 12:38",
"playAnimations" : "MH 5/10/2021 11:48",
"propertiesDictionary" : "LW 5/15/2021 15:05",
"propertyEditorPanel" : "DM 6/22/2020 01:27",
Expand All @@ -89,4 +89,4 @@
"updateInformationText:" : "DM 8/4/2020 16:18",
"windowReference" : "DM 8/4/2020 13:19",
"windowReference:" : "DM 8/4/2020 13:19",
"writeJsonToFile:with:" : "NB 5/21/2021 08:39" } }
"writeJsonToFile:with:" : "NB 5/27/2021 12:38" } }
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ startInformationDictionary: aMorph
with: #value -> aMorph rotationDegrees.
Dictionary
with: #name -> 'positionX'
with: #value -> aMorph x.
with: #value -> aMorph position x.
Dictionary
with: #name -> 'positionY'
with: #value -> aMorph y.
with: #value -> aMorph position y.
Dictionary
with: #name -> 'width'
with: #value -> aMorph width.
Expand All @@ -20,6 +20,6 @@ startInformationDictionary: aMorph
with: #value -> aMorph height.
Dictionary
with: #name -> 'color'
with: #value -> aMorph color rgbTriplet.
with: #value -> aMorph color printHtmlString asSymbol.
}.

Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@ saveJson
tearDown
(self animationsEditorInstance propertyList second) targetMorph abandon.
self animationsEditorInstance windowReference abandon.
super tearDown.


Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ testWriteJsonToFile
| jsonString fileContent |

jsonString := '{ "Test": { "id": "1"} }'.
self animationsEditorInstance writeJsonToFile: jsonString with: 'test'.
self animationsEditorInstance writeJsonToFile: jsonString with: 'test.json'.
fileContent := (FileStream fileNamed: 'test.json') contents.
self assert: fileContent isEmpty not.
self assert: fileContent isEmpty not.
(FileDirectory default) deleteFileNamed: 'test.json'.
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"setUp" : "NB 5/19/2021 10:25",
"sizeFrameDictionary" : "MH 5/20/2021 11:19",
"sizeTreeNode" : "LW 5/23/2021 12:30",
"startInformationDictionary:" : "MH 5/20/2021 11:22",
"tearDown" : "LW 5/23/2021 12:30",
"startInformationDictionary:" : "NB 5/27/2021 12:38",
"tearDown" : "NB 5/31/2021 13:02",
"testAddColorFrame" : "MH 5/20/2021 11:15",
"testAddMorphToJson" : "MH 5/20/2021 11:56",
"testAddPositionFrame" : "MH 5/20/2021 11:16",
Expand Down Expand Up @@ -50,4 +50,4 @@
"testTreeSpecWithNoMorph" : "DM 8/7/2020 18:59",
"testTreeSpecWithOneMorph" : "DM 8/7/2020 18:59",
"testTreeSpecWithOneMorphPosition" : "FH 5/13/2021 12:05",
"testWriteJsonToFile" : "NB 5/21/2021 09:08" } }
"testWriteJsonToFile" : "NB 5/31/2021 13:02" } }

0 comments on commit 19995f5

Please sign in to comment.