From c2b51bbba200cfdfebf1e32bfd85fe40d55bf986 Mon Sep 17 00:00:00 2001 From: Christopher Vogt Date: Sun, 19 Jun 2016 03:48:01 -0400 Subject: Rename scalatest-example folder. Probably slightly more intuitive name now. --- examples/build-scalatest/build/build.scala | 9 --------- examples/build-scalatest/build/build/build.scala | 8 -------- .../build-scalatest/src/main/scala/Hello.scala | 7 ------- examples/build-scalatest/src/test/scala/Test.scala | 23 ---------------------- examples/scalatest-example/build/build.scala | 9 +++++++++ examples/scalatest-example/build/build/build.scala | 8 ++++++++ .../scalatest-example/src/main/scala/Hello.scala | 7 +++++++ .../scalatest-example/src/test/scala/Test.scala | 23 ++++++++++++++++++++++ 8 files changed, 47 insertions(+), 47 deletions(-) delete mode 100644 examples/build-scalatest/build/build.scala delete mode 100644 examples/build-scalatest/build/build/build.scala delete mode 100644 examples/build-scalatest/src/main/scala/Hello.scala delete mode 100644 examples/build-scalatest/src/test/scala/Test.scala create mode 100644 examples/scalatest-example/build/build.scala create mode 100644 examples/scalatest-example/build/build/build.scala create mode 100644 examples/scalatest-example/src/main/scala/Hello.scala create mode 100644 examples/scalatest-example/src/test/scala/Test.scala (limited to 'examples') diff --git a/examples/build-scalatest/build/build.scala b/examples/build-scalatest/build/build.scala deleted file mode 100644 index 48248fd..0000000 --- a/examples/build-scalatest/build/build.scala +++ /dev/null @@ -1,9 +0,0 @@ -import cbt._ -class Build(val context: Context) extends SbtLayoutMain { - outer => - override def test: Option[ExitCode] = Some{ - new BasicBuild(context) with ScalaTest with SbtLayoutTest{ - override def dependencies = outer +: super.dependencies - }.run - } -} diff --git a/examples/build-scalatest/build/build/build.scala b/examples/build-scalatest/build/build/build.scala deleted file mode 100644 index d641b51..0000000 --- a/examples/build-scalatest/build/build/build.scala +++ /dev/null @@ -1,8 +0,0 @@ -import cbt._ - -class Build(val context: Context) extends BuildBuild{ - override def dependencies = super.dependencies ++ Seq( - plugins.scalaTest, - plugins.sbtLayout - ) -} diff --git a/examples/build-scalatest/src/main/scala/Hello.scala b/examples/build-scalatest/src/main/scala/Hello.scala deleted file mode 100644 index 099a84d..0000000 --- a/examples/build-scalatest/src/main/scala/Hello.scala +++ /dev/null @@ -1,7 +0,0 @@ -object Main extends App{ - - println("Hello World") - - def square(x: Int) = x * x - -} diff --git a/examples/build-scalatest/src/test/scala/Test.scala b/examples/build-scalatest/src/test/scala/Test.scala deleted file mode 100644 index 48b0a36..0000000 --- a/examples/build-scalatest/src/test/scala/Test.scala +++ /dev/null @@ -1,23 +0,0 @@ -import collection.mutable.Stack -import org.scalatest._ - -class Test extends FlatSpec with Matchers { - "square" should "return double" in { - Main.square(2) should be (4) - } - - "A Stack" should "pop values in last-in-first-out order" in { - val stack = new Stack[Int] - stack.push(1) - stack.push(2) - stack.pop() should be (2) - stack.pop() should be (1) - } - - it should "throw NoSuchElementException if an empty stack is popped" in { - val emptyStack = new Stack[Int] - a [NoSuchElementException] should be thrownBy { - emptyStack.pop() - } - } -} \ No newline at end of file diff --git a/examples/scalatest-example/build/build.scala b/examples/scalatest-example/build/build.scala new file mode 100644 index 0000000..48248fd --- /dev/null +++ b/examples/scalatest-example/build/build.scala @@ -0,0 +1,9 @@ +import cbt._ +class Build(val context: Context) extends SbtLayoutMain { + outer => + override def test: Option[ExitCode] = Some{ + new BasicBuild(context) with ScalaTest with SbtLayoutTest{ + override def dependencies = outer +: super.dependencies + }.run + } +} diff --git a/examples/scalatest-example/build/build/build.scala b/examples/scalatest-example/build/build/build.scala new file mode 100644 index 0000000..d641b51 --- /dev/null +++ b/examples/scalatest-example/build/build/build.scala @@ -0,0 +1,8 @@ +import cbt._ + +class Build(val context: Context) extends BuildBuild{ + override def dependencies = super.dependencies ++ Seq( + plugins.scalaTest, + plugins.sbtLayout + ) +} diff --git a/examples/scalatest-example/src/main/scala/Hello.scala b/examples/scalatest-example/src/main/scala/Hello.scala new file mode 100644 index 0000000..099a84d --- /dev/null +++ b/examples/scalatest-example/src/main/scala/Hello.scala @@ -0,0 +1,7 @@ +object Main extends App{ + + println("Hello World") + + def square(x: Int) = x * x + +} diff --git a/examples/scalatest-example/src/test/scala/Test.scala b/examples/scalatest-example/src/test/scala/Test.scala new file mode 100644 index 0000000..48b0a36 --- /dev/null +++ b/examples/scalatest-example/src/test/scala/Test.scala @@ -0,0 +1,23 @@ +import collection.mutable.Stack +import org.scalatest._ + +class Test extends FlatSpec with Matchers { + "square" should "return double" in { + Main.square(2) should be (4) + } + + "A Stack" should "pop values in last-in-first-out order" in { + val stack = new Stack[Int] + stack.push(1) + stack.push(2) + stack.pop() should be (2) + stack.pop() should be (1) + } + + it should "throw NoSuchElementException if an empty stack is popped" in { + val emptyStack = new Stack[Int] + a [NoSuchElementException] should be thrownBy { + emptyStack.pop() + } + } +} \ No newline at end of file -- cgit v1.2.3