|
The new method in TestResource class says;
new
"Use #current to get the valid current instance. Use of #new to get an instance (that should never be the current one) could be done in bizarre circumstances, so is not blocked, but will usually be inappropriate."
^super new initialize.
Notwithstanding the comment, this is still wrong, because super new is the method in Behavior, which is
^ self basicNew initialize
resulting in double initialization. I think that TestResource class>>#new should be self shouldNotImplement, with an appropriate comment explaining how to override it (self basicNew initialize) if circumstances are truly bizarre. Or, if you believe (as the writer of the current comment evidently did) that TestResource class new should work, just delete the new method in TestResource class entirely.
You may argue that the double initialization shouldn't matter, because TestResources are initialized in setUp, not in initialize. This is true, but irrelevant. In general, the creation of testResources is strange, and inadequacy documented, but this new method, and its comment, do not help.
|
|
|
Priority: 5 – Fix If Time
|
|
Status: Work Needed
|
|
Assigned to: Everyone
|
|
Milestone: Later
|
Go to Case
|
|