Skip to content

Commit

Permalink
prettyPrint and use path constant in test
Browse files Browse the repository at this point in the history
  • Loading branch information
vlindow committed May 23, 2024
1 parent 83f1672 commit 4e92a3f
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
instance creation
pathToExport
^ FileDirectory default fullName, FileDirectory default pathNameDelimiter, 'DataExports'
^ FileDirectory default fullName , FileDirectory default pathNameDelimiter , 'DataExports'
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ exportCSV
| filePath directory |
directory := FileDirectory on: self class pathToExport.
directory exists
ifFalse: [FileDirectory default createDirectory: self class pathToExport].
filePath := self class pathToExport, FileDirectory default pathNameDelimiter , self id , '.csv'.
ifFalse: [FileDirectory default createDirectory: self class pathToExport].
filePath := self class pathToExport , FileDirectory default pathNameDelimiter , self id , '.csv'.
(FileDirectory default fileExists: filePath)
ifTrue: [FileDirectory default deleteFileNamed: filePath].
FileStream
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"class" : {
"newWithPollDraft:" : "CG 7/30/2021 19:06",
"pathToExport" : "vl 5/22/2024 20:00" },
"pathToExport" : "vl 5/23/2024 16:53" },
"instance" : {
"addAnswerSet:" : "kge 8/1/2022 19:01",
"answerSets" : "JS 5/25/2021 15:32",
"answerSets:" : "JT 8/2/2022 17:07",
"answeredByUser:" : "kge 8/3/2022 21:34",
"closeWithPassword:" : "kge 8/1/2022 19:17",
"countNumberOfAnswersWithChoice:ForQuestion:" : "kge 8/3/2022 22:06",
"exportCSV" : "vl 5/22/2024 20:00",
"exportCSV" : "vl 5/23/2024 16:53",
"getChoiceIdentifiersFor:" : "kge 5/15/2022 13:02",
"getChoiceNamesFor:" : "kge 5/15/2022 13:02",
"getVotedChoicesPerChoiceFor:" : "kge 8/3/2022 22:04",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
testing
testCSVExport
| homeDirectory filePath fileStream buffer match |
| filePath fileStream buffer match |
self poll addAnswerSet: self as1.
self poll exportCSV.

homeDirectory := FileDirectory default fullName.
filePath := homeDirectory , FileDirectory default pathNameDelimiter , 'DataExports' , FileDirectory default pathNameDelimiter , self poll id , '.csv'.
filePath := LQPoll pathToExport , FileDirectory default pathNameDelimiter , self poll id , '.csv'.
fileStream := FileStream fileNamed: filePath.
buffer := fileStream contents.
match := 'Question 1;Question 2;
Q1A1:Q1A2;Q1A2;
'.
self assert: match equals: buffer.
fileStream close.
self assert: match equals: buffer.
fileStream close
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
},
"instance" : {
"testAnswerSetPollID" : "ms 8/5/2022 20:38",
"testCSVExport" : "vl 5/22/2024 20:00",
"testCSVExport" : "vl 5/23/2024 16:55",
"testClosePoll" : "ms 8/5/2022 20:38",
"testIDsAreUUIDsToPreventCollisions" : "JT 8/4/2022 23:31",
"testMyUserSet" : "ms 8/5/2022 20:39",
Expand Down

0 comments on commit 4e92a3f

Please sign in to comment.