Skip to content

Commit

Permalink
Reworked MockMessageSend printon so that it's display matches that of…
Browse files Browse the repository at this point in the history
… a normal messsage send, making it easier to compare in the debugger on a failure. (simpler is better)
  • Loading branch information
macta committed Apr 30, 2024
1 parent 7738c55 commit e6b60dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/SUnit-MockObjects-Tests/MockMessageSendTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MockMessageSendTest >> testBinaryMessagePrintOn [

mockMessage printOn: testStream.

self assert: (testStream contents includesSubstring: '#binaryMsg: true')
self assert: (testStream contents includesSubstring: 'binaryMsg: true')
]

{ #category : 'running' }
Expand All @@ -36,7 +36,7 @@ MockMessageSendTest >> testKeywordMessageArrayPrintOn [

mockMessage printOn: testStream.

self assert: (testStream contents includesSubstring: '#keyWord:msg: ( ''hello'', #(1 2 3) )')
self assert: (testStream contents includesSubstring: 'keyWord:msg: ( ''hello'', #(1 2 3) )')
]

{ #category : 'running' }
Expand All @@ -45,7 +45,7 @@ MockMessageSendTest >> testKeywordMessagePrintOn [

mockMessage printOn: testStream.

self assert: (testStream contents includesSubstring: '#keyWord:msg: ( ''hello'', ''world'' )')
self assert: (testStream contents includesSubstring: 'keyWord:msg: ( ''hello'', ''world'' )')
]

{ #category : 'running' }
Expand All @@ -54,5 +54,5 @@ MockMessageSendTest >> testUnaryMessagePrintOn [

mockMessage printOn: testStream.

self assert: (testStream contents includesSubstring: '#unaryMsg')
self assert: (testStream contents includesSubstring: 'unaryMsg')
]
3 changes: 1 addition & 2 deletions src/SUnit-MockObjects/MockMessageSend.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ MockMessageSend >> on: aSymbol with: anArray do: aBlock [
{ #category : 'printing' }
MockMessageSend >> printOn: aStream [

aStream nextPutAll: 'Expected Message: '.
selector printOn: aStream.
aStream nextPutAll: selector.

arguments isEmptyOrNil ifFalse: [
arguments size > 1 ifTrue: [ aStream nextPutAll: ' (' ].
Expand Down

0 comments on commit e6b60dd

Please sign in to comment.