Skip to content

Commit

Permalink
Fixing Tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Enzo-Demeulenaere committed Dec 4, 2023
1 parent 98a6d1f commit b8f8390
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 27 deletions.
13 changes: 13 additions & 0 deletions src/Bloc-Text-Alexandrie-Examples/BlTextElementExamples.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ BlTextElementExamples >> simpleText [
^ textElement
]

{ #category : #tests }
BlTextElementExamples >> testTextElement [

<sampleInstance>
| text textElement |
text := self helloText.
textElement := BlTextElement new.
textElement text: text.
textElement clipChildren: false.
self assert: textElement text equals: text.
^ textElement
]

{ #category : #example }
BlTextElementExamples >> textAttributes [

Expand Down
43 changes: 21 additions & 22 deletions src/Bloc-UnitedTests/BlExamplesMock.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ See my references.
"
Class {
#name : #BlExamplesMock,
#superclass : #BlExampleTest,
#superclass : #TestCase,
#instVars : [
'enabled'
],
Expand All @@ -19,45 +19,44 @@ BlExamplesMock >> enableRunning [
]

{ #category : #examples }
BlExamplesMock >> exampleError [
BlExamplesMock >> exampleWithArgument: arg [

self error

]

{ #category : #examples }
BlExamplesMock >> exampleFail [
{ #category : #initialization }
BlExamplesMock >> initialize [

self fail
super initialize.
enabled := false
]

{ #category : #examples }
BlExamplesMock >> examplePass [

{ #category : #private }
BlExamplesMock >> performTest [

enabled ifTrue: [ super performTest ]
]

{ #category : #examples }
BlExamplesMock >> exampleSkip [
BlExamplesMock >> testExampleError [

<noTest>
self error
]

{ #category : #examples }
BlExamplesMock >> exampleWithArgument: arg [
BlExamplesMock >> testExampleFail [


self fail
]

{ #category : #initialization }
BlExamplesMock >> initialize [

super initialize.
enabled := false
{ #category : #examples }
BlExamplesMock >> testExamplePass [


]

{ #category : #private }
BlExamplesMock >> performTest [
{ #category : #examples }
BlExamplesMock >> testExampleSkip [

enabled ifTrue: [ super performTest ]
self skip
]
10 changes: 5 additions & 5 deletions src/Bloc-UnitedTests/BlTestOfExamplesTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ BlTestOfExamplesTest >> testAllExamplesAreConsideredTests [

self
assertCollection: BlExamplesMock testSelectors
hasSameElements: #(examplePass exampleFail exampleError exampleSkip)
hasSameElements: #(#testExamplePass #testExampleFail #testExampleError #testExampleSkip)

]

Expand All @@ -27,7 +27,7 @@ BlTestOfExamplesTest >> testErrors [

self
assertCollection: (self examplesTestResult errors collect: [ :each | each selector ])
hasSameElements: #(exampleError)
hasSameElements: #(#testExampleError)

]

Expand All @@ -36,7 +36,7 @@ BlTestOfExamplesTest >> testFail [

self
assertCollection: (self examplesTestResult failures collect: [ :each | each selector ])
hasSameElements: #(exampleFail)
hasSameElements: #(#testExampleFail)

]

Expand All @@ -45,7 +45,7 @@ BlTestOfExamplesTest >> testPass [

self
assertCollection: (self examplesTestResult passed collect: [ :each | each selector ])
hasSameElements: #(examplePass)
hasSameElements: #(#testExamplePass)

]

Expand All @@ -54,6 +54,6 @@ BlTestOfExamplesTest >> testSkip [

self
assertCollection: (self examplesTestResult skipped collect: [ :each | each selector ])
hasSameElements: #(exampleSkip)
hasSameElements: #(#testExampleSkip)

]

0 comments on commit b8f8390

Please sign in to comment.