SUnitTests2.st
author Claus Gittinger <cg@exept.de>
Wed, 29 May 2019 01:12:49 +0200
changeset 747 1dcb53cf964d
parent 449 398e6eaf8de5
child 611 1eecc860f4a5
child 664 e31b2e7b658d
permissions -rw-r--r--
#FEATURE by cg class: TestCase added: #invokeTestMethod changed: #performTest support timeout annotation

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

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 $'
! !