Specs2 3.4

53
Specs2 3.x ScalaSyd

Transcript of Specs2 3.4

Page 1: Specs2 3.4

Specs2 3.x

ScalaSyd

Page 2: Specs2 3.4

Changes

User guide

API

ScalaCheck

HTML

& more

Page 3: Specs2 3.4

If you missed the beginning…

Page 4: Specs2 3.4

If you missed the beginning…

Page 5: Specs2 3.4

And more!

Page 6: Specs2 3.4

And more!

Page 7: Specs2 3.4

3.x, why?

Page 8: Specs2 3.4

Why?

http://bit.ly/lambdajam-2014-specs2

Scalaz

-stre

am in

side

Page 9: Specs2 3.4

9

Changes

Page 10: Specs2 3.4

10

User Guide

Page 11: Specs2 3.4

User Guide

Page 12: Specs2 3.4

User Guide

Page 13: Specs2 3.4

User Guide

Page 14: Specs2 3.4

User Guide

Page 15: Specs2 3.4

User Guide

Page 16: Specs2 3.4

Home Page

Page 17: Specs2 3.4

API - breaks

Page 18: Specs2 3.4

API - breaks

Before After

Page 19: Specs2 3.4

API - breaks

Contexts

Page 20: Specs2 3.4

Specification execution

Text1Text1

Example1Example1

Example2Example2

Example3Example3

Text1Text1

Step 1Step 1

Example2Example2

Example3Example3

Example1Example1

Page 21: Specs2 3.4

BeforeAll / AfterAll

Text1Text1

Step 1Step 1

Example2Example2

Example3Example3

Example1Example1

BeforeAllBeforeAll

AfterAllAfterAll

Page 22: Specs2 3.4

Example

Page 23: Specs2 3.4

Example

Example1Example1This is a great exampleThis is a great example

R : ResultR : Result

Page 24: Specs2 3.4

BeforeEach / AfterEach

Page 25: Specs2 3.4

BeforeEach / AfterEach

Example1Example1This is a great exampleThis is a great example

before

after

before

after

R : ResultR : Result

Page 26: Specs2 3.4

ForEach

Page 27: Specs2 3.4

ForEach

Example1Example1This is a great exampleThis is a great example

val t: T = ???

e

Result

val t: T = ???

e

Result

T => R : ResultT => R : Result

Page 28: Specs2 3.4

ForEach

Example1Example1This is a great exampleThis is a great example

val t: T = ???before

try f(t) finally after

val t: T = ???before

try f(t) finally after

T => R : ResultT => R : Result

Page 29: Specs2 3.4

API - breaks

Before After

Page 30: Specs2 3.4

API – nesting / graph

Before After

Page 31: Specs2 3.4

Specification links

Text1Text1

Link1Link1

Link2Link2

exampleexample

Example1Example1

Example2Example2

Example3Example3

Example4Example4

Link3Link3

Page 32: Specs2 3.4

Specification links

sbt> test-only Spec1[info] Spec1[info] Text1[info] * Spec2[info] * Spec3[info] + example

sbt> test-only Spec1[info] Spec1[info] Text1[info] * Spec2[info] * Spec3[info] + example

sbt> test-only Spec1 -- all[info] Spec2[info] Spec3[info][info] Spec1[info] Text1[info] + Spec2[info] + Spec3[info] + example

sbt> test-only Spec1 -- all[info] Spec2[info] Spec3[info][info] Spec1[info] Text1[info] + Spec2[info] + Spec3[info] + example

Page 33: Specs2 3.4

Before / After everything!

BeforeBefore

AfterAfter

Example1Example1

Example2Example2

BeforeBefore

AfterAfter

Spec nSpec n

Page 34: Specs2 3.4

API - fragments After

Page 35: Specs2 3.4

API - breaks

Before After

Page 36: Specs2 3.4

New stuff!

Page 37: Specs2 3.4

API - Specification After

Page 38: Specs2 3.4

API – Reader pattern After

Page 39: Specs2 3.4

API – Reader pattern After

Page 40: Specs2 3.4

API – Reporting After

Composable!

custom

Page 41: Specs2 3.4

HTML

Page 42: Specs2 3.4

HTML

Page 43: Specs2 3.4

HTML

Page 44: Specs2 3.4

Foreach - functionally

Page 45: Specs2 3.4

ScalaCheck

Page 46: Specs2 3.4

ScalaCheck

Page 47: Specs2 3.4

& more

Text1Text1 Example1Example1 Example2Example2 Example3Example3

Text1Text1 Example1Example1 Example2Example2 Example3Example3

Example2.1Example2.1 Example2.2Example2.2

Page 48: Specs2 3.4

& more

Page 49: Specs2 3.4

& more

Page 50: Specs2 3.4

& more

sbt> test-only FuturesSpec -- timefactor 3sbt> test-only FuturesSpec -- timefactor 3

Page 51: Specs2 3.4

& more

Page 52: Specs2 3.4

Can you help?

• try it and report issues!• extends the Notifier for Steps• fix/close #256: “make specs2 aware of JUnit categories”• create a PDF Printer• create an Eclipse plugin• add coverage to the build• add more specs/properties!

Page 53: Specs2 3.4

Thanks!

3.x, Doc!