[squeak-dev] The Trunk: SUnitTools-jr.5.mcz

commits at source.squeak.org commits at source.squeak.org
Wed Apr 27 13:52:24 UTC 2022


Marcel Taeumel uploaded a new version of SUnitTools to project The Trunk:
http://source.squeak.org/trunk/SUnitTools-jr.5.mcz

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

Name: SUnitTools-jr.5
Author: jr
Time: 5 March 2020, 9:53:04.92876 pm
UUID: 612a0a0e-43fa-de40-8370-f5e90d767232
Ancestors: SUnitTools-tcj.4

Allow to create a new test class immediately if none is found.

=============== Diff against SUnitTools-tcj.4 ===============

Item was added:
+ ----- Method: CodeHolder>>testAskToCreateNewTest: (in category '*SUnitTools-running') -----
+ testAskToCreateNewTest: className
+ 	(self confirm: 'Test class not found. Create one?') ifFalse: [^ false].
+ 	(ClassBuilder new)
+ 		name: className asSymbol
+ 		inEnvironment: self selectedClass environment
+ 		subclassOf: TestCase
+ 		type: #normal
+ 		instanceVariableNames: ''
+ 		classVariableNames: ''
+ 		poolDictionaries: ''
+ 		category:
+ 			((self selectedClass category includes: $-)
+ 				ifTrue: [((self selectedClass category copyUpToLast: $-), '-Tests')]
+ 				ifFalse: [(self selectedClass category, 'Tests')]) asSymbol.
+ 	^ true!

Item was changed:
  ----- Method: CodeHolder>>testBrowseClassNamed:possibleMessageNamed: (in category '*SUnitTools-running') -----
  testBrowseClassNamed: aClassName possibleMessageNamed: aMessageName
  	
  	| cls selector |
+ 	(self class environment hasClassNamed: aClassName) ifFalse:
+ 		[(self testAskToCreateNewTest: aClassName) ifFalse: [^ self]].
- 	(self class environment hasClassNamed: aClassName) ifFalse: ["no dice" ^ self].
  	cls := self class environment classNamed: aClassName.
  
  	(aMessageName notNil and: [cls includesLocalSelector: (selector := aMessageName asSymbol)])
  		ifTrue: [ToolSet browse: cls selector: selector]
  		ifFalse: [ToolSet browseClass: cls].!



More information about the Squeak-dev mailing list