Skip to content

Instantly share code, notes, and snippets.

@lhohan
Created December 10, 2013 15:09
Show Gist options
  • Save lhohan/7892113 to your computer and use it in GitHub Desktop.
Save lhohan/7892113 to your computer and use it in GitHub Desktop.
def shouldThrow[E<:Throwable](f: =>Unit) { try { f fail("should have thrown an Exception") } catch { case e:E => () case e => throw e } }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment