aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2013-03-04 15:05:04 -0600
committerJesse Luehrs <doy@tozt.net>2013-03-04 15:09:25 -0600
commitdd2ad6ffe6a57b4e93c01e447f49fcf8710e622f (patch)
tree3936729326cdcb2be2752e10576b78a7d42c634f
parentd8c4195da98291557062d270ee880c940c39d493 (diff)
downloadscala-test-more-dd2ad6ffe6a57b4e93c01e447f49fcf8710e622f.tar.gz
scala-test-more-dd2ad6ffe6a57b4e93c01e447f49fcf8710e622f.zip
remove the ability to skip and bail out with no reason
-rw-r--r--src/main/scala/org/perl8/test/TestMore.scala10
-rw-r--r--src/main/scala/org/perl8/test/tap/Producer.scala16
-rw-r--r--src/main/scala/org/perl8/test/tap/TestBuilder.scala11
-rw-r--r--src/test/scala/org/perl8/test/tap/TestBuilderTest.scala6
4 files changed, 3 insertions, 40 deletions
diff --git a/src/main/scala/org/perl8/test/TestMore.scala b/src/main/scala/org/perl8/test/TestMore.scala
index b412215..f0b29f7 100644
--- a/src/main/scala/org/perl8/test/TestMore.scala
+++ b/src/main/scala/org/perl8/test/TestMore.scala
@@ -72,10 +72,6 @@ class TestMore (plan: Plan = NoPlan) extends Test with DelayedInit {
builder.diag(message)
}
- def BAIL_OUT {
- builder.bailOut
- }
-
def BAIL_OUT (desc: String) {
builder.bailOut(desc)
}
@@ -91,12 +87,6 @@ class TestMore (plan: Plan = NoPlan) extends Test with DelayedInit {
}
}
- def skip (count: Int)(body: => Unit) {
- for (i <- 1 to count) {
- builder.skip
- }
- }
-
def skip (count: Int, reason: String)(body: => Unit) {
for (i <- 1 to count) {
builder.skip(reason)
diff --git a/src/main/scala/org/perl8/test/tap/Producer.scala b/src/main/scala/org/perl8/test/tap/Producer.scala
index 2b919af..7f5edaf 100644
--- a/src/main/scala/org/perl8/test/tap/Producer.scala
+++ b/src/main/scala/org/perl8/test/tap/Producer.scala
@@ -32,19 +32,12 @@ object Producer {
def todoResult (cond: Boolean, num: Int, desc: String, todo: String): String =
result(cond, num, desc) + " # TODO " + todo
- /** Returns a skipped test result.
- *
- * @example `ok 4 # skip`
- */
- def skip (num: Int): String =
- "ok " + num + " # skip"
-
/** Returns a skipped test result with a reason.
*
* @example `ok 4 # skip this test won't run here`
*/
def skip (num: Int, reason: String): String =
- skip(num) + " " + reason
+ "ok " + num + " # skip " + reason
/** Returns a comment.
*
@@ -61,13 +54,6 @@ object Producer {
def plan (plan: Plan): String =
plan.skipAll.map(m => "1..0 # SKIP " + m).getOrElse("1.." + plan.plan)
- /** Returns a bail out.
- *
- * @example `Bail out!`
- */
- def bailOut: String =
- "Bail out!"
-
/** Returns a bail out with a reason.
*
* @example `Bail out! Not supported on this platform.`
diff --git a/src/main/scala/org/perl8/test/tap/TestBuilder.scala b/src/main/scala/org/perl8/test/tap/TestBuilder.scala
index da6732f..15305d1 100644
--- a/src/main/scala/org/perl8/test/tap/TestBuilder.scala
+++ b/src/main/scala/org/perl8/test/tap/TestBuilder.scala
@@ -38,11 +38,6 @@ class TestBuilder private (
outLine(Producer.todoResult(test, state.currentTest, description, todo))
}
- def skip {
- state.ok(true)
- outLine(Producer.skip(state.currentTest))
- }
-
def skip (reason: String) {
state.ok(true)
outLine(Producer.skip(state.currentTest, reason))
@@ -56,12 +51,6 @@ class TestBuilder private (
outLine(Producer.comment(message))
}
- def bailOut {
- val bailOutMessage = Producer.bailOut
- outLine(bailOutMessage)
- throw new BailOutException(bailOutMessage)
- }
-
def bailOut (message: String) {
val bailOutMessage = Producer.bailOut(message)
outLine(bailOutMessage)
diff --git a/src/test/scala/org/perl8/test/tap/TestBuilderTest.scala b/src/test/scala/org/perl8/test/tap/TestBuilderTest.scala
index eb0536a..a9fbf6d 100644
--- a/src/test/scala/org/perl8/test/tap/TestBuilderTest.scala
+++ b/src/test/scala/org/perl8/test/tap/TestBuilderTest.scala
@@ -207,7 +207,6 @@ class TestBuilderTest extends TestMore {
val builder = new TestBuilder
builder.ok(false)
builder.skip("not now")
- builder.skip
builder.doneTesting
}
}
@@ -215,9 +214,8 @@ class TestBuilderTest extends TestMore {
val expected =
"not ok 1\n" +
"ok 2 # skip not now\n" +
- "ok 3 # skip\n" +
- "1..3\n" +
- "# Looks like you failed 1 test of 3.\n"
+ "1..2\n" +
+ "# Looks like you failed 1 test of 2.\n"
is(output.toString, expected)
}