Skip to content

reqT/NanoZap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

NanoZap

A minimalistic Scala DSL for testing.

Example usage

object myTestCases extends reqT.NanoZap {
 def zap: Boolean = test("Arithmetic basics") { 
   "basic addition" .
       test { 1 + 1 == 3 } +
   "associativity of multiplication" .
       test { 2 * 3 == 3 * 2 } 
  }
}

String is pimped with a test method that can be used to accumulate non-empty strings.

NanoZap gets loud when a non-empty string is detected.

scala> :pa
// Entering paste mode (ctrl-D to finish)

   object myTestCases extends reqT.NanoZap {
    def zap: Boolean = test("Arithmetic basics") {
      "basic addition" .
          test { 1 + 1 == 3 } +
      "associativity of multiplication" .
          test { 2 * 3 == 3 * 2 }
     }
   }

// Exiting paste mode, now interpreting.

defined module myTestCases

scala> myTestCases.zap
NanoZap test(Arithmetic basics) ... ZAPPED!
*** TEST FAILED: basic addition

res0: Boolean = false

scala>

About

A minimalistic Scala DSL for testing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages