diff --git a/src/Spec2-Core/SpNumberInputFieldPresenter.class.st b/src/Spec2-Core/SpNumberInputFieldPresenter.class.st index 37d402b7..eea05786 100644 --- a/src/Spec2-Core/SpNumberInputFieldPresenter.class.st +++ b/src/Spec2-Core/SpNumberInputFieldPresenter.class.st @@ -227,7 +227,7 @@ SpNumberInputFieldPresenter >> whenNumberChangedDo: aBlock [ - old value - the announcement triggering this action" - self whenTextChangedDo: [ :txt | aBlock value: self number ] + self whenTextChangedDo: [ :newValue :oldValue | aBlock cull: self number cull: newValue ] ] { #category : 'api - events' } diff --git a/src/Spec2-Tests/SpNumberInputFieldPresenterTest.class.st b/src/Spec2-Tests/SpNumberInputFieldPresenterTest.class.st index a9e176ea..2a6f6c71 100644 --- a/src/Spec2-Tests/SpNumberInputFieldPresenterTest.class.st +++ b/src/Spec2-Tests/SpNumberInputFieldPresenterTest.class.st @@ -76,6 +76,16 @@ SpNumberInputFieldPresenterTest >> testWhenNumberChangedDo [ self assert: result equals: 10 ] +{ #category : 'tests' } +SpNumberInputFieldPresenterTest >> testWhenNumberChangedDo2Arguments [ + + presenter + number: 10; + whenNumberChangedDo: [ :newValue :oldValue | self deny: newValue equals: oldValue ]. + presenter number: 32. + +] + { #category : 'tests' } SpNumberInputFieldPresenterTest >> testWhenNumberTypeChangedDo [ | count result |