Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximilianKleissl committed Jul 6, 2020
1 parent 9a8e0c4 commit f4479f2
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,8 @@
open / save
openFile

| fc stream dict |
| fc |
fc := FileChooser new.
fc initializeAsDialogBox.
fc setSuffixes: {self fileEnding}.
stream := fc open.

stream ifNotNil: [
self currentFilePath: stream name.
dict := STON fromStream: stream.
self textMorph setText: (dict at: 'text').
self applySavedStyleSettingsFrom: dict]
self openStream: (fc open)
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
open / save
openStream: aStream

| dict |

aStream ifNotNil: [
self currentFilePath: aStream name.
dict := STON fromStream: aStream.
self textMorph setText: (dict at: 'text').
self applySavedStyleSettingsFrom: dict]
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,9 @@
"markdownText:" : "cg 7/5/2020 12:20",
"menuBarHeight" : "azi 6/1/2020 16:13",
"menubarContent:" : "MK 7/6/2020 14:32",
"openFile" : "MK 7/6/2020 14:48",
"openFile" : "MK 7/6/2020 17:07",
"openSettings" : "MK 7/6/2020 14:39",
"openStream:" : "MK 7/6/2020 17:04",
"putDictionaryOn:" : "MK 7/6/2020 14:40",
"refreshText" : "azi 6/1/2020 17:21",
"saveAsFile" : "MK 7/6/2020 14:40",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
test - open / close
testCurrentFilePath

| editor |
editor := MarkdownEditor new.
editor currentFilePath: 'Test test'.
self assert: editor currentFilePath equals: 'Test test'
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
test - open / close
testFileEnding

| editor |
editor := MarkdownEditor new.
self assert: editor fileEnding equals: 'mde'
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
test - open / close
testSaveAndOpen

| editor |
window delete.
FileStream fileNamed: 'testSaveAndOpenTestFile.mde'.
editor := MarkdownEditor new.
window := toolbuilder open: editor.
editor openFile.
self assert: True.
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,12 @@
"testBuildingEditorTextMorphReturnsSpec" : "lpf 6/13/2019 15:29",
"testConvertToHtml" : "MK 7/3/2020 19:55",
"testCreateNewEditorInstanceInWorld" : "MK 7/6/2020 14:43",
"testCurrentFilePath" : "MK 7/6/2020 16:33",
"testFileEnding" : "MK 7/6/2020 16:31",
"testMenuBarExists" : "MK 5/14/2020 13:04",
"testMenuOpenCommand" : "jst 5/11/2019 19:56",
"testOpenMarkdownOptions" : "cg 7/5/2020 11:57",
"testSaveAndOpen" : "MK 7/6/2020 17:11",
"testTextPersistenceForBlockStyling" : "jst 6/29/2019 14:39",
"testTextPersistenceForInlineStyling" : "MAS 5/9/2020 21:45",
"testWindowCreation" : "jst 5/11/2019 19:49",
Expand Down

0 comments on commit f4479f2

Please sign in to comment.