scalatest.FunSpec: ignore with xit
To ignore a spec for a few runs (normally only to refactor before I can actually implement the spec) Scalatest allows you to 'ignore' the test. Consider the following example spec.
class SomeSpec extends FunSpec {
describe("Something") {
it ("does something") { .. }
}
}
To temporarily ignore the spec you can replace 'it' with 'ignore'
describe("Something") {
ignore ("does something") { .. }
}
That's okay, but it gets a little annoying. Especially since it can also be done with a single key character (I'm not talking vim or emacs keystrokes here).
At least a number of other spec libraries allow you to ignore a spec by putting an 'x' in front of it, i.e. by using 'xit' instead of 'it'. You can do the same with Scalatest by delegating 'xit' to the standard ignore.
def xit(description: String, tags: scalatest.Tag*)(fn: => Unit) = ignore(description, tags:_*)(fn)
Written by Bart Bakker
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Scalatest
Authors
jm2dev
1.343K
Related Tags
#scalatest
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#