[Pkg] Sake : Sake-Tests-kph.48.mcz
squeak-dev-noreply at lists.squeakfoundation.org
squeak-dev-noreply at lists.squeakfoundation.org
Sat Oct 25 23:59:39 UTC 2008
A new version of Sake-Tests was added to project Sake :
http://www.squeaksource.com/Sake/Sake-Tests-kph.48.mcz
==================== Summary ====================
Name: Sake-Tests-kph.48
Author: kph
Time: 26 October 2008, 12:59:38 am
UUID: 7f81d5d7-d450-4eab-8550-bd35aa715867
Ancestors: Sake-Tests-kph.47
use SakeTask file:
=============== Diff against Sake-Tests-kph.47 ===============
Item was changed:
----- Method: SakeTaskTest class>>ruleDirectory (in category 'as yet unclassified') -----
ruleDirectory
+ ^ (SakeTask file: 'testDir') in: [ :task |
- ^ (SakeFileTask file: 'testDir') in: [ :task |
+ task action: [ task target mkdir ]
- task action: [ task file mkdir ]
]
!
Item was added:
+ ----- Method: SakeTaskTest>>traceAction: (in category 'as yet unclassified') -----
+ traceAction: aMessage
+
+ self log sake <<< (trace add: aMessage).
+ !
Item was changed:
----- Method: SakeTaskTest>>runCaseWith: (in category 'as yet unclassified') -----
runCaseWith: aBlock
"this method provides a place for subclasses to override in order to enclose running of test cases
within a testing context e.g. PRCurrentContext value: self context during: aBlock"
trace := OrderedCollection new.
+ SakeSignal context: self during: aBlock
- [ aBlock value ] on: SakeTrace do: [ :ex | self log sake <<< (trace add: ex messageText). ex resume. ]
-
!
Item was added:
+ ----- Method: SakeTaskTest class>>ruleReturnPriorTaskResults (in category 'as yet unclassified') -----
+ ruleReturnPriorTaskResults
+
+ ^ SakeTask define: [ :task |
+
+ task dependsOn: { self ruleD. }.
+ task action: [ :priorTasks | priorTasks collect: #result ]
+
+ ]!
Item was changed:
----- Method: SakeTaskTest>>testContext (in category 'as yet unclassified') -----
testContext
- self assert: (SakeTask noop context selector = #noop).
- self assert: (SakeTask noop context receiver = SakeTask).
-
- self assert: ((SakeTask define: [:a | ]) context selector = #testContext).
- self assert: ((SakeTask define: [:a | ]) context receiver = self ).
-
- self assert: ((SakeTask new define: [:a | ]) context selector = #testContext).
- self assert: ((SakeTask new define: [:a | ]) context receiver = self ).
+ "tasks can run within a context, here the context is self, so #lookupDoubleAction is performed with: 2"
+
+ self assert: ((SakeTask noop lookup: #lookupDoubleAction: with: 2) = 4).
+
+ "if no arg is supplied the task is fed in"
+ self assert: ((SakeTask noop lookup: #lookupSomeValue: ) = SakeTask noop).
!
Item was added:
+ ----- Method: SakeFileTaskTest>>testRuleFile (in category 'as yet unclassified') -----
+ testRuleFile
+
+ (Smalltalk classNamed: 'RioKernel') isNil ifTrue: [ self fail ].
+
+ self deny: ('testDir/test' asRio exists).
+
+ SakeTaskTest ruleFile run.
+
+ self assert: ('testDir/test' asRio contents = 'ruleFile').!
Item was added:
+ ----- Method: SakeTaskTest>>lookupSomeValue: (in category 'as yet unclassified') -----
+ lookupSomeValue: aTask
+
+ ^ aTask!
Item was changed:
----- Method: SakeMetaTest>>testKeyNotPresent (in category 'as yet unclassified') -----
testKeyNotPresent
+ self should: [ info test = nil ]
- self should: [ info test ] raise: Error
-
"
self debug: #testKeyNotPresent
"!
Item was added:
+ ----- Method: SakeTaskTest>>lookupDoubleAction: (in category 'as yet unclassified') -----
+ lookupDoubleAction: aValue
+
+ ^ aValue * 2!
Item was changed:
----- Method: SakeTaskTest>>testDependentsResults (in category 'as yet unclassified') -----
testDependentsResults
"does not work with non Rake ordering".
+ self assert: (SakeTaskTest ruleReturnPriorTaskResults run = #( ruleD )).
- self assert: (SakeTaskTest ruleReturnResults run = #( ruleD )).
!
Item was changed:
----- Method: SakeTaskTest class>>ruleFile (in category 'as yet unclassified') -----
ruleFile
+ ^ (SakeTask file: 'testDir/test') in: [ :task |
- ^ (SakeFileTask file: 'testDir/test') in: [ :task |
task dependsOn: { self ruleDirectory }.
+ task action: [ task target contents: 'ruleFile' ]
- task action: [ task file contents: 'ruleFile' ]
]
!
Item was removed:
- ----- Method: SakeTaskTest class>>ruleReturnResults (in category 'as yet unclassified') -----
- ruleReturnResults
-
- ^ SakeTask define: [ :task |
-
- task dependsOn: { self ruleD. }.
- task action: [ task results ]
-
- ]!
Item was removed:
- ----- Method: SakeTaskTest>>testRuleFile (in category 'as yet unclassified') -----
- testRuleFile
-
- (Smalltalk classNamed: 'RioKernel') isNil ifTrue: [ self fail ].
-
- self deny: ('testDir/test' asRio exists).
-
- SakeTaskTest ruleFile run.
-
- self assert: ('testDir/test' asRio contents = 'ruleFile').!
More information about the Packages
mailing list