Skip to content

Commit

Permalink
[Cleanup] #notNil to #isNotNil in Spec
Browse files Browse the repository at this point in the history
Fix #1526
  • Loading branch information
astares committed Feb 27, 2024
1 parent 8d688aa commit 2d5f1e4
Show file tree
Hide file tree
Showing 26 changed files with 46 additions and 46 deletions.
14 changes: 7 additions & 7 deletions src/Spec2-Adapters-Morphic/SpFontStyle.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,10 @@ SpFontStyle >> addFontToCache: aFont [
{ #category : 'private' }
SpFontStyle >> anyFontDecorator [

^ color notNil
or: [ size notNil
or: [ bold notNil
or: [ italic notNil ] ] ]
^ color isNotNil
or: [ size isNotNil
or: [ bold isNotNil
or: [ italic isNotNil ] ] ]
]

{ #category : 'private' }
Expand Down Expand Up @@ -217,7 +217,7 @@ SpFontStyle >> colorVariable [
SpFontStyle >> definedFont [
| definedFont |

(self predefinedFont notNil and: [ self anyFontDecorator not ]) ifTrue: [
(self predefinedFont isNotNil and: [ self anyFontDecorator not ]) ifTrue: [
^ self obtainPredefinedFont ].

self withCachedFontDo: [ :aFont | ^ aFont ].
Expand All @@ -238,7 +238,7 @@ SpFontStyle >> displayScaleFactor [
{ #category : 'private' }
SpFontStyle >> hasPredefinedFont [

^ self predefinedFont notNil
^ self predefinedFont isNotNil
]

{ #category : 'testing' }
Expand All @@ -258,7 +258,7 @@ SpFontStyle >> isItalic [
{ #category : 'testing' }
SpFontStyle >> isReset [

^ name notNil and: [ name isResetVariable ]
^ name isNotNil and: [ name isResetVariable ]
]

{ #category : 'accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ SpMorphicTableCellBuilder >> visitCheckboxColumn: aTableColumn [
SpMorphicTableCellBuilder >> visitCompositeColumn: aTableColumn [

super visitCompositeColumn: aTableColumn.
(aTableColumn isExpandable and: [ aTableColumn width notNil ])
(aTableColumn isExpandable and: [ aTableColumn width isNotNil ])
ifTrue: [
cell hResizing: #rigid.
cell width: aTableColumn width ]
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic/SpMorphicTableColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ SpMorphicTableColumn >> width: aNumber [
widthToAdd := addEmptySpace
ifTrue: [ aNumber - self emptySpace ]
ifFalse: [ aNumber ].
(self model isExpandable and: [ aNumber notNil ])
(self model isExpandable and: [ aNumber isNotNil ])
ifTrue: [ self model width: widthToAdd ] ].
super width: widthToAdd
]
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ SpMorphicTreeTableAdapter >> addColumnsFromPresenterTo: tableMorph [
fixed width of column: I need to enlarge that width with the width of the expander."
self columns withIndexDo: [ :each :index | | column |
column := self newColumnFrom: each.
(index = 1 and: [ column width notNil ]) ifTrue: [
(index = 1 and: [ column width isNotNil ]) ifTrue: [
column addEmptySpace.
"column width: column width + SpMorphicTreeTableDataSource emptyMorph width" ].
tableMorph addColumn: column ].
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic/SpNotebookPageMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SpNotebookPageMorph >> actualPageMorph: anObject [
{ #category : 'testing' }
SpNotebookPageMorph >> isRendered [

^ actualPageMorph notNil
^ actualPageMorph isNotNil
]

{ #category : 'accessing' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic/SpToolbarButtonMorph.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ SpToolbarButtonMorph >> getLabelSelector: aSelector [

{ #category : 'accessing' }
SpToolbarButtonMorph >> hasBadge [
^ self badge notNil
^ self badge isNotNil
]

{ #category : 'style' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ SpToolbarToggleButtonMorph >> getLabelSelector: aSelector [

{ #category : 'accessing' }
SpToolbarToggleButtonMorph >> hasBadge [
^ self badge notNil
^ self badge isNotNil
]

{ #category : 'style' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Adapters-Morphic/SpTreeColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ SpTreeColumn >> setHeaderButtonLabel: aLabel font: aFont icon: anIconForm target
ifNotNil: [ self header label: aLabel font: aFont ].
anIconForm
ifNotNil: [ self header icon: (ImageMorph new form: anIconForm) ].
(aSelector notNil and: [ aReceiver notNil ])
(aSelector isNotNil and: [ aReceiver isNotNil ])
ifFalse: [ ^ self ].
self header actionSelector: aSelector.
self header target: aReceiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ SpCodeMethodInteractionModelTest >> testBehavior [
SpCodeMethodInteractionModelTest >> testBindingOf [

self assert: (interactionModel bindingOf: #somethingNotExistent) isNil.
self assert: (interactionModel bindingOf: #Object) notNil
self assert: (interactionModel bindingOf: #Object) isNotNil
]

{ #category : 'tests' }
Expand Down
4 changes: 2 additions & 2 deletions src/Spec2-Code-Tests/SpCodePresenterTest.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SpCodePresenterTest >> testContextKeyBindings [
| contextKeyBindings |

contextKeyBindings := presenter contextKeyBindings.
self assert: contextKeyBindings notNil.
self assert: contextKeyBindings isNotNil.
self assert: (contextKeyBindings isKindOf: KMCategory).

]
Expand Down Expand Up @@ -141,7 +141,7 @@ SpCodePresenterTest >> testDoBrowseClassReferences [
presenter selectionInterval: (1 to: 19).
presenter doBrowseClassReferences.

self assert: navigation messageList notNil.
self assert: navigation messageList isNotNil.
self assert: navigation messageList notEmpty
]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,13 @@ SpCodeScriptingInteractionModelTest >> testBehavior [
SpCodeScriptingInteractionModelTest >> testBindingOf [

"auto create of bindings on demand (it will always answer a value)"
self assert: (interactionModel bindingOf: #somethingNotExistent) notNil.
self assert: (interactionModel bindingOf: #somethingNotExistent) isNotNil.
self assert: (interactionModel bindingOf: #somethingNotExistent) value isNil.
"... even if it is an Object variable... is this correct?"
self assert: (interactionModel bindingOf: #Object) notNil.
self assert: (interactionModel bindingOf: #Object) isNotNil.
self assert: (interactionModel bindingOf: #Object) value isNil.
"and of course it will answer our added bindings"
self assert: (interactionModel bindingOf: #testVar) notNil.
self assert: (interactionModel bindingOf: #testVar) isNotNil.
self assert: (interactionModel bindingOf: #testVar) value equals: 42


Expand Down
6 changes: 3 additions & 3 deletions src/Spec2-Code/SpCodePresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ SpCodePresenter >> doBrowseSenders [
variable := self lookupEnvironment lookupVar: variableOrClassName.

"For global and class variables, sender-of shows intead the using methods"
(variable notNil and: [(variable isGlobalVariable or: [variable isClassVariable])])
(variable isNotNil and: [(variable isGlobalVariable or: [variable isClassVariable])])
ifTrue: [ self systemNavigation openBrowserFor: variable name withMethods: variable usingMethods ]
ifFalse: [ self systemNavigation browseAllReferencesTo: variableOrClassName ]

Expand Down Expand Up @@ -494,7 +494,7 @@ SpCodePresenter >> hasLineNumbers [
{ #category : 'testing' }
SpCodePresenter >> hasResetAction [

^ resetBlock notNil
^ resetBlock isNotNil
]

{ #category : 'testing' }
Expand All @@ -506,7 +506,7 @@ SpCodePresenter >> hasSmartCharacters [
{ #category : 'testing' }
SpCodePresenter >> hasSubmitAction [

^ submitBlock notNil
^ submitBlock isNotNil
]

{ #category : 'testing' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Code/SpContextInteractionModel.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ SpContextInteractionModel >> hasBindingOf: aString [
{ #category : 'testing' }
SpContextInteractionModel >> hasUnsavedCodeChanges [

^ context notNil and: [ context sourceCode ~= owner text asString ]
^ context isNotNil and: [ context sourceCode ~= owner text asString ]
]

{ #category : 'testing' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-CommandLine/SpApplication.extension.st
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ SpApplication class >> applicationName [
{ #category : '*Spec2-CommandLine' }
SpApplication class >> findAll [

^ self allSubclasses select: [ :each | each applicationName notNil ]
^ self allSubclasses select: [ :each | each applicationName isNotNil ]
]

{ #category : '*Spec2-CommandLine' }
Expand Down
8 changes: 4 additions & 4 deletions src/Spec2-Core/SpAbstractPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -271,25 +271,25 @@ SpAbstractPresenter >> forceUpdateSlot: aSymbol [
{ #category : 'testing' }
SpAbstractPresenter >> hasAdapter [

^ adapter notNil
^ adapter isNotNil
]

{ #category : 'testing' }
SpAbstractPresenter >> hasAnnouncer [

^ announcer notNil
^ announcer isNotNil
]

{ #category : 'testing' }
SpAbstractPresenter >> hasEventHandler [

^ eventHandler notNil and: [ eventHandler hasEvents ]
^ eventHandler isNotNil and: [ eventHandler hasEvents ]
]

{ #category : 'testing' }
SpAbstractPresenter >> hasOwner [

^ self owner notNil
^ self owner isNotNil
]

{ #category : 'testing' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpDialogWindowPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ SpDialogWindowPresenter >> executeDefaultAction [
{ #category : 'testing' }
SpDialogWindowPresenter >> hasDefaultButton [

^ defaultButton notNil
^ defaultButton isNotNil
]

{ #category : 'initialization' }
Expand Down
4 changes: 2 additions & 2 deletions src/Spec2-Core/SpDropListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,9 @@ SpDropListPresenter >> getList [
SpDropListPresenter >> hasIcons [
"Answer whether the dropdown list will show icons"

^ iconBlock notNil and: [
^ iconBlock isNotNil and: [
self model collection anySatisfy: [ :each |
each icon notNil or: [ (self getIconFor: each) notNil ] ] ]
each icon isNotNil or: [ (self getIconFor: each) isNotNil ] ] ]
]

{ #category : 'api' }
Expand Down
4 changes: 2 additions & 2 deletions src/Spec2-Core/SpListPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ SpListPresenter >> clickOnSelectedItem [
| item |

item := self selection selectedItem.
^ item notNil
^ item isNotNil
and: [ (item respondsTo: #click)
and: [ item click ] ]
]
Expand Down Expand Up @@ -114,7 +114,7 @@ SpListPresenter >> hasHeaderTitle [
SpListPresenter >> hasIcons [
"Answer true if the list has an icon provider (See `SpListPresenter>>#icons:`)."

^ self displayIcon notNil
^ self displayIcon isNotNil
]

{ #category : 'api' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpMenuItemPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ SpMenuItemPresenter >> description: aString [
{ #category : 'testing' }
SpMenuItemPresenter >> hasShortcut [

^ self shortcut notNil
^ self shortcut isNotNil
]

{ #category : 'api' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpNotebookPageLabelPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ SpNotebookPageLabelPresenter >> label [
{ #category : 'accessing - model' }
SpNotebookPageLabelPresenter >> model: aModel [

(model notNil
(model isNotNil
and: [ model ~= aModel ])
ifTrue: [ self unsubscribePage: model ].

Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpStringTableColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -142,5 +142,5 @@ SpStringTableColumn >> sortFunction: aBlockOrSortFunction [
^ self ].

super sortFunction: aBlockOrSortFunction asSortFunction.
self isSortable: aBlockOrSortFunction notNil
self isSortable: aBlockOrSortFunction isNotNil
]
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpTSearchable.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ SpTSearchable >> enableSearch [
SpTSearchable >> hasCustomSearch [
"Answer true if the list has a custom search defined (See `SpListPresenter>>#searchMatching:`"

^ searchBlock notNil
^ searchBlock isNotNil
]

{ #category : 'initialization' }
Expand Down
2 changes: 1 addition & 1 deletion src/Spec2-Core/SpTableColumn.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ SpTableColumn >> isExpandable [
SpTableColumn >> isSortable [
"Answer if this column is sortable"

^ self sortFunction notNil
^ self sortFunction isNotNil
]

{ #category : 'private' }
Expand Down
8 changes: 4 additions & 4 deletions src/Spec2-Core/SpWindowPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -237,29 +237,29 @@ SpWindowPresenter >> hasDecorations [
SpWindowPresenter >> hasMenu [
"Answer if window has a menu defined"

^ self menu notNil
^ self menu isNotNil
]

{ #category : 'testing' }
SpWindowPresenter >> hasPresenter: aPresenter [
"Answer if window includes `aPresenter`"

^ aPresenter isNotNil and: [aPresenter adapter notNil
^ aPresenter isNotNil and: [aPresenter adapter isNotNil
and: [ self adapter hasWidget: aPresenter adapter ]]
]

{ #category : 'testing' }
SpWindowPresenter >> hasStatusBar [
"Answer if window has a status bar defined"

^ self statusBar notNil
^ self statusBar isNotNil
]

{ #category : 'testing' }
SpWindowPresenter >> hasToolbar [
"Answer if window has a toolbar defined"

^ self toolbar notNil and: [ self toolbar notEmpty ]
^ self toolbar isNotNil and: [ self toolbar notEmpty ]
]

{ #category : 'api' }
Expand Down
4 changes: 2 additions & 2 deletions src/Spec2-Layout/SpTAlignable.trait.st
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ SpTAlignable >> hasAlignment [
SpTAlignable >> hasHAlign [
"Answer whether the component has an horizontal alignment defined"

^ hAlign notNil
^ hAlign isNotNil
]

{ #category : 'testing' }
SpTAlignable >> hasVAlign [
"Answer whether the component has a vertical alignment defined"

^ vAlign notNil
^ vAlign isNotNil
]

{ #category : 'accessing' }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ SpAbstractWidgetPresenterDeferringActionTest >> testWithAdapterPerformOrDeferExe
presenter adapter: Object new.
presenter withAdapterPerformOrDefer: [ :anAdapter |
executed := anAdapter. ].
self assert: executed notNil
self assert: executed isNotNil
]

0 comments on commit 2d5f1e4

Please sign in to comment.