From dd2ad6ffe6a57b4e93c01e447f49fcf8710e622f Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Mon, 4 Mar 2013 15:05:04 -0600 Subject: remove the ability to skip and bail out with no reason --- src/main/scala/org/perl8/test/TestMore.scala | 10 ---------- src/main/scala/org/perl8/test/tap/Producer.scala | 16 +--------------- src/main/scala/org/perl8/test/tap/TestBuilder.scala | 11 ----------- src/test/scala/org/perl8/test/tap/TestBuilderTest.scala | 6 ++---- 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) } -- cgit v1.2.3