-
-
Notifications
You must be signed in to change notification settings - Fork 353
/
DrTestsTestRunnerTest.class.st
83 lines (74 loc) · 2.16 KB
/
DrTestsTestRunnerTest.class.st
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
"
A DrTestsUITest is a test class for testing the behavior of DrTests-TestRunner
"
Class {
#name : #DrTestsTestRunnerTest,
#superclass : #TestCase,
#instVars : [
'plugin',
'package',
'testToReRun',
'conf',
'reRunconf',
'testCase'
],
#category : #'DrTests-Tests'
}
{ #category : #running }
DrTestsTestRunnerTest >> setUp [
super setUp.
package := RPackage organizer
packageNamed: 'DrTests-TestCoverage-MocksForTests'.
testToReRun := DTCoverageMockTest
selector: #testMethod1forMock.
testCase := DTCoverageMockTest.
conf := DTPluginConfiguration
items:
({package}
flatCollect:
[ :p | p definedClasses select: [ :c | c allSuperclasses includes: TestCase ] ])
packages: {package}.
reRunconf := DTReRunConfiguration new.
plugin := DTTestsRunner new
]
{ #category : #tests }
DrTestsTestRunnerTest >> testAllSelectedClassesAreTestCases [
| package |
package := plugin packagesAvailableForAnalysis anyOne.
self assert: ((plugin itemsToBeAnalysedFor: {package}) flattened allSatisfy: [ :each | each isTestCase ])
]
{ #category : #tests }
DrTestsTestRunnerTest >> testReRunResultIsDTTestRunnerResult [
| pluginResult |
pluginResult := plugin runForConfiguration: conf.
reRunconf := DTReRunConfiguration new
previousResult: pluginResult;
configurationToRun: (DTTestsRunnerConfiguration items: { testToReRun });
yourself.
self
assert: (plugin runForConfiguration: reRunconf) class
equals: DTTestsRunnerResult
]
{ #category : #tests }
DrTestsTestRunnerTest >> testRunResultBuildTreeForUI [
self
assert: (plugin runForConfiguration: conf) buildTreeForUI class
equals: DTTreeNode
]
{ #category : #tests }
DrTestsTestRunnerTest >> testRunResultIsDTTestRunnerResult [
self
assert: (plugin runForConfiguration: conf) class
equals: DTTestsRunnerResult
]
{ #category : #tests }
DrTestsTestRunnerTest >> testSelectedPackagesContainTestCases [
self assert: (plugin packagesAvailableForAnalysis allSatisfy: [ :package |
package definedClasses anySatisfy: [ :class |
class isTestCase ] ])
]
{ #category : #tests }
DrTestsTestRunnerTest >> testTestResultIsNotEmpty [
self
deny: (plugin runForConfiguration: conf) testsResult passed isEmpty
]