Skip to content

Instantly share code, notes, and snippets.

@SeanTAllen
Created December 23, 2011 21:46
Show Gist options
  • Save SeanTAllen/1515445 to your computer and use it in GitHub Desktop.
Save SeanTAllen/1515445 to your computer and use it in GitHub Desktop.
New Assertion.st
" Redline Smalltalk, Copyright (c) James C. Ladd. All rights reserved. See LICENSE in the root of this distribution "
Object < #Assertion
+ assert: anObject equals: expectedObject withMessage: aString
anObject = expectedObject ifFalse: [ Object error: aString ].
+ assert: anObject notEqualTo: unexpectedObject withMessage: aString
anObject = unexpectedObject ifFalse: [ Object error: aString ].
+ assertTrue: aBlock withMessage: aString
aBlock value ifFalse: [ Object error: aString ].
+ assertFalse: aBlock withMessage: aString
aBlock value ifTrue: [ Object error: aString ].
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment