Skip to content

Instantly share code, notes, and snippets.

@mtgto
Last active December 16, 2015 15:49
Show Gist options
  • Save mtgto/5458909 to your computer and use it in GitHub Desktop.
Save mtgto/5458909 to your computer and use it in GitHub Desktop.
Specs2でinのネストができなくなってた!
import org.specs2.mutable.Specification
class HogeSpec extends Specification {
"One" should {
"Two test" in {
2 === 2
}
"Two" in {
"Three test" in {
3 === 3
}
"Three" in {
"Four test" in {
4 === 4
}
"Four" in {
"Five test" in {
5 === 5
}
"Five" in {
"Six test" in {
6 === 6
}
}
}
}
}
}
}
// https://github.com/etorreborre/specs2/blob/master/notes/1.12.markdown
import org.specs2.mutable.Specification
class HogeSpec extends Specification {
"One" should {
"Two test" >> {
2 === 2
}
"Two" >> {
"Three test" >> {
3 === 3
}
"Three" >> {
"Four test" >> {
4 === 4
}
"Four" >> {
"Five test" >> {
5 === 5
}
"Five" >> {
"Six test" >> {
6 === 6
}
}
}
}
}
}
}
[info] HogeSpec
[info]
[info] One should
[info] + Two test
[info] Two
[info] + Three test
[info] Three
[info] + Four test
[info] Four
[info] + Five test
[info] Five
[info] + Six test
[info]
[info]
[info]
[info]
[info]
[info]
[info] Total for specification HogeSpec
[info] Finished in 95 ms
[info] 5 examples, 0 failure, 0 error
[info]
[info] Passed: : Total 5, Failed 0, Errors 0, Passed 5, Skipped 0
[info] HogeSpec
[info]
[info] One should
[info] + Two test
[info] Two
[info]
[info] + Three test
[info] Three
[info]
[info] + Four test
[info] Four
[info]
[info] + Five test
[info] Five
[info] + Six test
[info]
[info]
[info]
[info] Total for specification HogeSpec
[info] Finished in 191 ms
[info] 5 examples, 0 failure, 0 error
[info]
[info] Passed: : Total 5, Failed 0, Errors 0, Passed 5, Skipped 0
[info] HogeSpec
[info]
[info] One should
[info] + Two test
[info] + Two
[info]
[info]
[info] Total for specification HogeSpec
[info] Finished in 20 ms
[info] 2 examples, 0 failure, 0 error
[info]
[info] Passed: : Total 2, Failed 0, Errors 0, Passed 2, Skipped 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment