Skip to content

Commit

Permalink
Pass on event tests in order to fix package dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
tinchodias committed May 9, 2024
1 parent fe7d493 commit 90f5e13
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 18 deletions.
Expand Up @@ -4,7 +4,7 @@ A BlLayoutTest is a test class for testing the behavior of BlLayout
Class {
#name : #BlLayoutTest,
#superclass : #TestCase,
#category : #'Bloc-Tests-Layouts-Basic'
#category : #'Bloc-Layout-Tests'
}

{ #category : #tests }
Expand Down
2 changes: 1 addition & 1 deletion src/Bloc-Tests/BlEventDispatcherTest.class.st
Expand Up @@ -5,7 +5,7 @@ I have been automatically converted and probably manually tweaked from BlEventDi
Class {
#name : #BlEventDispatcherTest,
#superclass : #TestCase,
#category : #'Bloc-Tests'
#category : #'Bloc-Tests-Events'
}

{ #category : #tests }
Expand Down
16 changes: 8 additions & 8 deletions src/Bloc-Tests/BlEventTest.class.st
Expand Up @@ -5,7 +5,7 @@ I have been automatically converted and probably manually tweaked from BlEventEx
Class {
#name : #BlEventTest,
#superclass : #TestCase,
#category : #'Bloc-Tests'
#category : #'Bloc-Tests-Events'
}

{ #category : #tests }
Expand All @@ -19,7 +19,7 @@ BlEventTest >> newBlueElement [
{ #category : #tests }
BlEventTest >> newCustomEvent [

^ BlExampleCustomEvent new
^ BlMockedEvent new
payload: 'Hello world!';
yourself
]
Expand All @@ -28,14 +28,14 @@ BlEventTest >> newCustomEvent [
BlEventTest >> newCustomEventListener [

^ BlEventHandler
on: BlExampleCustomEvent
on: BlMockedEvent
do: [ :aCustomEvent | aCustomEvent consume ]
]

{ #category : #tests }
BlEventTest >> newCustomEventTarget [

^ BlExampleCustomEventTarget new
^ BlMockedEventTarget new
]

{ #category : #tests }
Expand Down Expand Up @@ -160,19 +160,19 @@ BlEventTest >> testRemoveEventHandlerAnsweredByAddEventHandlerOnDo [
"Add two handlers that increase a counter on each handled event."
handlerA :=
target
addEventHandlerOn: BlExampleCustomEvent
addEventHandlerOn: BlMockedEvent
do: [ :_ | countA := countA + 1 ].
handlerB :=
target
addEventHandlerOn: BlExampleCustomEvent
addEventHandlerOn: BlMockedEvent
do: [ :_ | countB := countB + 1 ].
target dispatchEvent: BlExampleCustomEvent new.
target dispatchEvent: BlMockedEvent new.
self assert: countA equals: 1.
self assert: countB equals: 1.

"After removing handlerA, countA doesn't increase."
target removeEventHandler: handlerA.
target dispatchEvent: BlExampleCustomEvent new.
target dispatchEvent: BlMockedEvent new.
self assert: countA equals: 1.
self assert: countB equals: 2
]
Expand Down
Expand Up @@ -3,20 +3,20 @@ I am an example of a custom bloc event
"
Class {
#name : #BlExampleCustomEvent,
#name : #BlMockedEvent,
#superclass : #BlEvent,
#instVars : [
'payload'
],
#category : #'Bloc-Examples-Event'
#category : #'Bloc-Tests-Events'
}

{ #category : #accessing }
BlExampleCustomEvent >> payload [
BlMockedEvent >> payload [
^ payload
]

{ #category : #accessing }
BlExampleCustomEvent >> payload: anObject [
BlMockedEvent >> payload: anObject [
payload := anObject
]
Expand Up @@ -3,26 +3,26 @@ I am an example of a custom non-element event target that can be nicely integrat
"
Class {
#name : #BlExampleCustomEventTarget,
#name : #BlMockedEventTarget,
#superclass : #Object,
#traits : 'TBlEventTarget',
#classTraits : 'TBlEventTarget classTrait',
#instVars : [
'eventDispatcher'
],
#category : #'Bloc-Examples-Event'
#category : #'Bloc-Tests-Events'
}

{ #category : #accessing }
BlExampleCustomEventTarget >> eventDispatcher [
BlMockedEventTarget >> eventDispatcher [
"Return an object responsible for event dispatching"
<return: #BlDirectEventDispatcher>

^ eventDispatcher
]

{ #category : #initialization }
BlExampleCustomEventTarget >> initialize [
BlMockedEventTarget >> initialize [
super initialize.

eventDispatcher := BlDirectEventDispatcher on: self
Expand Down

0 comments on commit 90f5e13

Please sign in to comment.