Skip to content

Commit

Permalink
Merge pull request #707 from jecisc/693-Add-the-method-clearContent-i…
Browse files Browse the repository at this point in the history
…n-the-class-SpAbstractTextPresenter

693-Add-the-method-clearContent-in-the-class-SpAbstractTextPresenter
  • Loading branch information
jecisc committed Aug 12, 2019
2 parents b28bde5 + 0504e7a commit 16a842d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Spec2-Core/SpAbstractTextPresenter.class.st
Expand Up @@ -95,6 +95,11 @@ SpAbstractTextPresenter >> autoAccept: aBoolean [
autoAccept := aBoolean
]

{ #category : #api }
SpAbstractTextPresenter >> clearContent [
self text: ''
]

{ #category : #api }
SpAbstractTextPresenter >> clearSelection [
" <api: #do>"
Expand Down
8 changes: 8 additions & 0 deletions src/Spec2-Tests/SpTextPresenterTest.class.st
Expand Up @@ -14,6 +14,14 @@ SpTextPresenterTest >> initializationText [
presenter text: 'Text for tests.'
]

{ #category : #tests }
SpTextPresenterTest >> testClearContent [
self initializationText.
self denyEmpty: presenter text.
presenter clearContent.
self assertEmpty: presenter text
]

{ #category : #tests }
SpTextPresenterTest >> testClearSelection [
self initializationText.
Expand Down

0 comments on commit 16a842d

Please sign in to comment.