File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed
scalatest-test/src/test/scala/org/scalatest/concurrent Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -98,16 +98,19 @@ class ConductorSuite extends FunSuite with Matchers with Conductors with Severed
98
98
" must have a unique name" ) {
99
99
100
100
val conductor = new Conductor
101
- conductor.threadNamed(" Fiesta del Mar" ) { 1 should be (1 ) }
102
- val caught =
103
- intercept[NotAllowedException ] {
104
- conductor.threadNamed(" Fiesta del Mar" ) { 2 should be (2 ) }
101
+ try {
102
+ conductor.threadNamed(" Fiesta del Mar" ) { 1 should be (1 ) }
103
+ val caught =
104
+ intercept[NotAllowedException ] {
105
+ conductor.threadNamed(" Fiesta del Mar" ) { 2 should be (2 ) }
106
+ }
107
+ caught.getMessage should be (" Cannot register two threads with the same name. Duplicate name: Fiesta del Mar." )
108
+ caught.failedCodeFileNameAndLineNumberString match {
109
+ case Some (s) => s should equal (" ConductorSuite.scala:" + (thisLineNumber - 4 ))
110
+ case None => fail(" Didn't produce a file name and line number string: " , caught)
105
111
}
106
- caught.getMessage should be (" Cannot register two threads with the same name. Duplicate name: Fiesta del Mar." )
107
- caught.failedCodeFileNameAndLineNumberString match {
108
- case Some (s) => s should equal (" ConductorSuite.scala:" + (thisLineNumber - 4 ))
109
- case None => fail(" Didn't produce a file name and line number string: " , caught)
110
112
}
113
+ finally conductor.conduct
111
114
}
112
115
113
116
test(" waitForBeat throws NotAllowedException if is called with zero or a negative number" ) {
You can’t perform that action at this time.
0 commit comments