diff options
author | Jesse Luehrs <doy@tozt.net> | 2013-02-20 10:31:00 -0600 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2013-02-20 10:31:00 -0600 |
commit | bba83124121c6e014f8ae6369345caf6e0273202 (patch) | |
tree | f03d753a85f77a571967a8b905eca459e91c4e8a /src/test/scala | |
parent | 29b02e36cf3206a0728b44a068717fbbd38d2f20 (diff) | |
download | scala-test-more-bba83124121c6e014f8ae6369345caf6e0273202.tar.gz scala-test-more-bba83124121c6e014f8ae6369345caf6e0273202.zip |
remove some duplication
Diffstat (limited to 'src/test/scala')
-rw-r--r-- | src/test/scala/basic.scala | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/src/test/scala/basic.scala b/src/test/scala/basic.scala index 0294a3a..94a2af6 100644 --- a/src/test/scala/basic.scala +++ b/src/test/scala/basic.scala @@ -1,12 +1,18 @@ import org.scalatest.FunSuite +import org.scalatest.BeforeAndAfter import testbuilder._ import java.io.ByteArrayOutputStream -class Basic extends FunSuite { +class Basic extends FunSuite with BeforeAndAfter { + private val output = new ByteArrayOutputStream + + before { + output.reset + } + test ("ok") { - val output = new ByteArrayOutputStream val builder = new Builder(4, output) builder.ok(true, "test succeeded") builder.ok(false, "test failed") @@ -26,7 +32,6 @@ class Basic extends FunSuite { } test ("no plan") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.ok(true, "test succeeded") builder.ok(false, "test failed") @@ -46,7 +51,6 @@ class Basic extends FunSuite { } test ("empty") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.doneTesting @@ -58,7 +62,6 @@ class Basic extends FunSuite { } test ("diag") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.ok(true, "the test passes") @@ -79,7 +82,6 @@ class Basic extends FunSuite { } test ("is passing") { - val output = new ByteArrayOutputStream val builder = new Builder(output) assert(!builder.isPassing) @@ -92,7 +94,6 @@ class Basic extends FunSuite { } test ("bail out") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.ok(true) @@ -109,7 +110,6 @@ class Basic extends FunSuite { } test ("skip all") { - val output = new ByteArrayOutputStream val builder = new Builder(SkipAll(), output) val expected = @@ -119,7 +119,6 @@ class Basic extends FunSuite { } test ("skip all with reason") { - val output = new ByteArrayOutputStream val builder = new Builder(SkipAll("foo bar"), output) val expected = @@ -129,7 +128,6 @@ class Basic extends FunSuite { } test ("skip") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.ok(false) @@ -148,7 +146,6 @@ class Basic extends FunSuite { } test ("todo") { - val output = new ByteArrayOutputStream val builder = new Builder(output) builder.ok(false, "do a thing", "not working yet") |