Return to Snippet

Revision: 3096
at June 3, 2007 16:49 by thebugslayer


Initial Code
class ConcurrentErrorTest extends GroovyTestCase {
	void testError(){
		shouldFail(ConcurrentModificationException){
			def list = [1,2,3]
			list.eachWithIndex{e, i->
				list.remove(i)
			}
		}
	}
}

Initial URL

                                

Initial Description
Groovy save you from using try/catch that expect exception in junit.

Initial Title
Quick Unit Testing

Initial Tags

                                

Initial Language
Groovy