Skip to content

Commit

Permalink
Updated to use the string interpolation version for specs2 acceptance…
Browse files Browse the repository at this point in the history
… spec style.
  • Loading branch information
cheeseng committed Nov 20, 2013
1 parent 79c4592 commit 15aad64
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 33 deletions.
18 changes: 9 additions & 9 deletions allClassTestsInOneFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ def generateSpecs2Immutable(testCount: Int, targetDir: File): File = {
package iSpecification
import org.specs2cls._
class ExampleSpec extends SpecificationClass { def is =
"Scala can" ^
""")
class ExampleSpec extends SpecificationClass { def is =""" + "\n" +
" s2\"\"\"Scala can ^"
)

for (x <- 1 to testCount)
targetOut.write(" \"increment " + x + "\" ! e" + x + "^\n")
targetOut.write(" end\n")
targetOut.write(" \"increment " + x + "\" $e" + x + "^\n")

targetOut.write(" \"\"\"\n")

for (x <- 1 to testCount)
targetOut.write("def e" + x + " = " + x + " + 1 must beEqualTo (" + (x+1) + ")\n")
Expand Down Expand Up @@ -309,7 +309,7 @@ if (scalaVersion != "unknown") {
fileCountFile.write(headers)
fileSizeFile.write(headers)

styles.foreach { style =>
styles.foreach { style =>
testTypes.foreach { testType =>
durationFile.write(style.name) // + " " + testType.name) Don't write with MustMatchers to get all 4 names to fit on graph
durationFile.flush()
Expand Down
18 changes: 9 additions & 9 deletions allTestsInOneFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ def generateSpecs2Immutable(testCount: Int, targetDir: File): File = {
package iSpecification
import org.specs2._
class ExampleSpec extends Specification { def is =
"Scala can" ^
""")
class ExampleSpec extends Specification { def is =""" + "\n" +
" s2\"\"\"Scala can ^"
)

for (x <- 1 to testCount)
targetOut.write(" \"increment " + x + "\" ! e" + x + "^\n")
targetOut.write(" end\n")
targetOut.write(" \"increment " + x + "\" $e" + x + "^\n")

targetOut.write(" \"\"\"\n")

for (x <- 1 to testCount)
targetOut.write("def e" + x + " = " + x + " + 1 must be equalTo (" + (x+1) + ")\n")
Expand Down Expand Up @@ -282,7 +282,7 @@ if (scalaVersion != "unknown") {
fileCountFile.write(headers)
fileSizeFile.write(headers)

styles.foreach { style =>
styles.foreach { style =>
testTypes.foreach { testType =>
durationFile.write(style.name) // + " " + testType.name) Don't write with MustMatchers to get all 4 names to fit on graph
durationFile.flush()
Expand Down
12 changes: 6 additions & 6 deletions tenTestsPerFile.scala
Original file line number Diff line number Diff line change
Expand Up @@ -168,14 +168,14 @@ package iSpecification
import org.specs2._
class ExampleSpec""" + fileNumber + """ extends Specification { def is =
"Scala can" ^
""")
class ExampleSpec""" + fileNumber + " extends Specification { def is =\n" +
" s2\"\"\"Scala can ^"
)

for (x <- 1 to testCount)
targetOut.write(" \"increment " + x + "\" ! e" + x + "^\n")
targetOut.write(" \"increment " + x + "\" $e" + x + "^\n")

targetOut.write(" end\n")
targetOut.write(" \"\"\"\n")

for (x <- 1 to testCount)
targetOut.write("def e" + x + " = " + x + " + 1 must be equalTo (" + (x+1) + ")\n")
Expand Down Expand Up @@ -345,7 +345,7 @@ if (scalaVersion != "unknown") {
fileCountFile.write(headers)
fileSizeFile.write(headers)

styles.foreach { style =>
styles.foreach { style =>
testTypes.foreach { testType =>
try {
durationFile.write(style.name) // Don't write with MustMatchers to get all 4 names to fit on graph
Expand Down
18 changes: 9 additions & 9 deletions testsIn100Files.scala
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ def generateSpecs2Immutable(testCount: Int, targetDir: File, fileNumber: Int): F
package iSpecification
import org.specs2._
class ExampleSpec""" + fileNumber + """ extends Specification { def is =
"Scala can" ^
""")
class ExampleSpec""" + fileNumber + " extends Specification { def is =\n" +
" s2\"\"\"Scala can ^"
)

for (x <- 1 to testCount)
targetOut.write(" \"increment " + x + "\" ! e" + x + "^\n")
targetOut.write(" end\n")
targetOut.write(" \"increment " + x + "\" $e" + x + "^\n")

targetOut.write(" \"\"\"\n")

for (x <- 1 to testCount)
targetOut.write("def e" + x + " = " + x + " + 1 must be equalTo (" + (x+1) + ")\n")
Expand Down Expand Up @@ -305,7 +305,7 @@ if (scalaVersion != "unknown") {
fileCountFile.write(headers)
fileSizeFile.write(headers)

styles.foreach { style =>
styles.foreach { style =>
testTypes.foreach { testType =>
try {
durationFile.write(style.name) // Don't write with MustMatchers to get all 4 names to fit on graph
Expand Down

0 comments on commit 15aad64

Please sign in to comment.