SUnitTests2.st
author Jan Vrany <jan.vrany@fit.cvut.cz>
Sun, 26 Nov 2017 20:40:34 +0000
branchjv
changeset 696 268bf2c60556
parent 664 e31b2e7b658d
permissions -rw-r--r--
UI testing: wait until event queue empties ...when `#do:`ing an user action. This is necessary for widget/tools that pushes more work back onto an even queue (in order to make the system more responsive).

"{ Package: 'stx:goodies/sunit' }"

"{ NameSpace: Smalltalk }"

TestCase subclass:#SUnitTests2
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	category:'SUnit-Smalltalk/X-Tests'
!

TestCase subclass:#TestCaseWithErrorInTearDown
	instanceVariableNames:''
	classVariableNames:''
	poolDictionaries:''
	privateIn:SUnitTests2
!

!SUnitTests2 class methodsFor:'documentation'!

documentation
"
    More tests for SUnit. Uses St/X private classes.

    [author:]
        Jan Vrany <jan.vrany@fit.cvut.cz>

    [instance variables:]

    [class variables:]

    [see also:]

"
! !

!SUnitTests2 methodsFor:'tests'!

testErrorInTearDown

    | result |

    result := TestCaseWithErrorInTearDown buildSuite run.
    self assert: result errors size == 2.

    "Created: / 16-01-2012 / 20:07:28 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SUnitTests2::TestCaseWithErrorInTearDown class methodsFor:'testing'!

isAbstract

    "HACK: To prevent it being run by normal tools..."

    ^(thisContext sender selector == #buildSuite) not.

    "Created: / 16-01-2012 / 20:41:07 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SUnitTests2::TestCaseWithErrorInTearDown methodsFor:'running'!

tearDown

    10 perform: ' zork '

    "Created: / 16-01-2012 / 19:55:18 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SUnitTests2::TestCaseWithErrorInTearDown methodsFor:'tests'!

testFail

    self assert: false

    "Created: / 16-01-2012 / 19:54:53 / Jan Vrany <jan.vrany@fit.cvut.cz>"
!

testPass

    self assert: true

    "Created: / 16-01-2012 / 19:54:45 / Jan Vrany <jan.vrany@fit.cvut.cz>"
! !

!SUnitTests2 class methodsFor:'documentation'!

version
    ^ '$Header: /cvs/stx/stx/goodies/sunit/SUnitTests2.st,v 1.2 2012-08-02 20:56:07 vrany Exp $'
!

version_CVS
    ^ '$Header: /cvs/stx/stx/goodies/sunit/SUnitTests2.st,v 1.2 2012-08-02 20:56:07 vrany Exp $'
! !