diff --git a/source/Kepler-Notifications-Tests/EventNotificationModuleTest.class.st b/source/Kepler-Notifications-Tests/EventNotificationModuleTest.class.st index 2d5b516..c785125 100644 --- a/source/Kepler-Notifications-Tests/EventNotificationModuleTest.class.st +++ b/source/Kepler-Notifications-Tests/EventNotificationModuleTest.class.st @@ -3,26 +3,26 @@ An EventNotificationModuleTest is a test class for testing the behavior of Event " Class { #name : #EventNotificationModuleTest, - #superclass : #SystemBasedUserStoryTest, + #superclass : #TestCase, + #instVars : [ + 'userStory' + ], #category : #'Kepler-Notifications-Tests' } { #category : #'private - accessing' } EventNotificationModuleTest >> installedModuleRegistrationSystem [ - ^ rootSystem >> #InstalledModuleRegistrationSystem + ^ userStory rootSystem >> #InstalledModuleRegistrationSystem ] -{ #category : #'private - configuring' } -EventNotificationModuleTest >> requireEventNotificationModule [ +{ #category : #running } +EventNotificationModuleTest >> setUp [ - self requireInstallationOf: EventNotificationModule -] - -{ #category : #'private - running' } -EventNotificationModuleTest >> setUpRequirements [ - - self requireEventNotificationModule + super setUp. + userStory := PluggableUserStoryTest + requiring: [ :test | test requireInstallationOf: EventNotificationModule ]. + userStory setUp ] { #category : #tests } diff --git a/source/Kepler-SUnit-Model/PluggableUserStoryTest.class.st b/source/Kepler-SUnit-Model/PluggableUserStoryTest.class.st new file mode 100644 index 0000000..2b087d8 --- /dev/null +++ b/source/Kepler-SUnit-Model/PluggableUserStoryTest.class.st @@ -0,0 +1,37 @@ +" +I'm a kind of configurable user story test. +My intention is to be used in composition relations with other tests that cannot subclass directly SystemBasedUserStoryTest. +The users just need to provide a block configuring the requirements. +" +Class { + #name : #PluggableUserStoryTest, + #superclass : #SystemBasedUserStoryTest, + #instVars : [ + 'requirementSetUp' + ], + #category : #'Kepler-SUnit-Model' +} + +{ #category : #'instance creation' } +PluggableUserStoryTest class >> requiring: aRequirementSetUpBlock [ + + ^self new initializeRequiring: aRequirementSetUpBlock +] + +{ #category : #initialization } +PluggableUserStoryTest >> initializeRequiring: aRequirementSetUpBlock [ + + requirementSetUp := aRequirementSetUpBlock +] + +{ #category : #accessing } +PluggableUserStoryTest >> rootSystem [ + + ^ rootSystem +] + +{ #category : #'private - running' } +PluggableUserStoryTest >> setUpRequirements [ + + requirementSetUp value: self +]