Frank Shearar uploaded a new version of KernelTests to project The Trunk:
http://source.squeak.org/trunk/KernelTests-fbs.258.mcz==================== Summary ====================
Name: KernelTests-fbs.258
Author: fbs
Time: 9 January 2014, 10:50:00.468 pm
UUID: 0de21eb7-01e8-fe46-9e09-b0142c95bb61
Ancestors: KernelTests-cmm.257
Improve the error messages used by BlockContext.
Make #testNew actually test stuff. This reveals that BlockContext >> #basicNew does _not_, in fact, fail.
=============== Diff against KernelTests-cmm.257 ===============
Item was changed:
----- Method: BlockContextTest>>testNew (in category 'tests') -----
testNew
+ self should: [ContextPart new: 5] raise: Error.
- self should: [ContextPart new: 5] raise: Error.
[ContextPart new: 5]
+ on: Error do: [:e|
+ self assert: (e messageText includesSubString: 'newForMethod:') description: 'Error doesn''t tell you what you did wrong by calling #new:'].
- ifError: [:error :receiver | error = 'Error: Contexts must only be created with newForMethod:'].
- [ContextPart new]
- ifError: [:error :receiver | error = 'Error: Contexts must only be created with newForMethod:'].
- [ContextPart basicNew]
- ifError: [:error :receiver | error = 'Error: Contexts must only be created with newForMethod:'].
+ self should: [ContextPart new] raise: Error.
+ [ContextPart new]
+ on: Error do: [:e|
+ self assert: (e messageText includesSubString: 'newForMethod:') description: 'Error doesn''t tell you what you did wrong by calling #new'].!
- !
Item was changed:
----- Method: BlockContextTest>>testOneArgument (in category 'tests') -----
testOneArgument
| c |
c := OrderedCollection new.
c add: 'hello'.
[c
do: [1 + 2]]
ifError: [:err :rcvr | self deny: err = 'This block requires 0 arguments.'].
[c
do: [:arg1 :arg2 | 1 + 2]]
ifError: [:err :rcvr | self deny: err = 'This block requires 2 arguments.'] !
Item was changed:
----- Method: BlockContextTest>>testRunSimulated (in category 'tests') -----
testRunSimulated
+ self assert: Rectangle equals: (ContextPart runSimulated: aBlockContext) class.!
- self assert: (ContextPart runSimulated: aBlockContext) class = Rectangle.!