[squeak-dev] The Trunk: SUnit-ct.130.mcz

commits at source.squeak.org commits at source.squeak.org
Sun Jan 16 20:40:52 UTC 2022

Christoph Thiede uploaded a new version of SUnit to project The Trunk:

==================== Summary ====================

Name: SUnit-ct.130
Author: ct
Time: 24 September 2020, 11:28:31.626426 am
UUID: 43df5072-3a69-634c-946a-ec59903c2519
Ancestors: SUnit-pre.122

Deprecates TestResult class >> #error and replaces sends to it with #exError. It is a bad and erroneous practice to override #error in a way that does not signal an error but returns a class object.

=============== Diff against SUnit-pre.122 ===============

Item was changed:
  ----- Method: SUnitTest>>testDialectLocalizedException (in category 'tests') -----
  		should: [TestResult signalFailureWith: 'Foo']
  		raise: TestResult failure.
  		should: [TestResult signalErrorWith: 'Foo']
+ 		raise: TestResult exError.!
- 		raise: TestResult error.
- 			!

Item was changed:
  ----- Method: SUnitTest>>testException (in category 'tests') -----
  		should: [self error: 'foo']
+ 		raise: TestResult exError!
- 		raise: TestResult error
- 			!

Item was changed:
  ----- Method: SUnitTest>>testWithExceptionDo (in category 'tests') -----
  		should: [self error: 'foo']
+ 		raise: TestResult exError
- 		raise: TestResult error
  		withExceptionDo: [:exception |
  			self assert: (exception description includesSubstring: 'foo')
+ 		]!
- 		]
- 			!

Item was changed:
  ----- Method: TestResult class>>error (in category 'exceptions') -----
+ 	self deprecated: 'ct: Send #exError to retrieve an exception class or #error: to signal an error, depending on what you need.'.
+ 	^ self exError!
- 	^self exError
- 			!

Item was changed:
  ----- Method: TestResult class>>signalErrorWith: (in category 'exceptions') -----
  signalErrorWith: aString 
+ 	^ self exError signal: aString!
- 	self error signal: aString
- 			!

More information about the Squeak-dev mailing list