The Inbox: SUnit-ct.130.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: SUnit-ct.130.mcz

commits-2
Christoph Thiede uploaded a new version of SUnit to project The Inbox:
http://source.squeak.org/inbox/SUnit-ct.130.mcz

==================== 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') -----
  testDialectLocalizedException
 
  self
  should: [TestResult signalFailureWith: 'Foo']
  raise: TestResult failure.
  self
  should: [TestResult signalErrorWith: 'Foo']
+ raise: TestResult exError.!
- raise: TestResult error.
-
- !

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

Item was changed:
  ----- Method: SUnitTest>>testWithExceptionDo (in category 'tests') -----
  testWithExceptionDo
 
  self
  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') -----
  error
+
+ 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
- !