Skip to content

Commit

Permalink
Updated README
Browse files Browse the repository at this point in the history
  • Loading branch information
Jarosław Michalik committed Jul 10, 2018
1 parent a409d2b commit b64c32a
Showing 1 changed file with 34 additions and 6 deletions.
40 changes: 34 additions & 6 deletions README.MD
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
# Spek BDD Extensions
[![](https://jitpack.io/v/rozkminiacz/SpekBddDsl.svg)](https://jitpack.io/#rozkminiacz/SpekBddDsl)

>only Spek 1.x is supported
## About
This library provides some extensions for [Spek](http://spekframework.org/), to match Behavior-Driven-Development specifications language.

| Spek BDD DSL | Spek DSL |
|---: | ---: |
| Scenario | group |
| Story | group |
| Given | group |
| When | group |
Expand Down Expand Up @@ -44,12 +47,7 @@ import me.rozkmin.spekbdd.BddDsl.Then
import me.rozkmin.spekbdd.BddDsl.When
import org.jetbrains.spek.api.Spek

import org.junit.Assert.assertTrue
import org.junit.platform.runner.JUnitPlatform
import org.junit.runner.RunWith

@RunWith(JUnitPlatform::class)
object SpekBddExample : Spek({
class SpekBddExample : Spek({
Story("user is looking for a bus") {
//setup context of a user
Given("bus list screen") {
Expand All @@ -76,6 +74,36 @@ object SpekBddExample : Spek({

```

## Disabling test groups
add `x` before method call - this will ignore specific test or container.
For example, don't want to test "user has favorite stops" yet, but we want to have full specification written:
```kotlin
class ManyCaseScenarioSample : Spek({
Scenario("user is looking for a bus") {
//setup context of a user
Given("bus list screen") {
When("enters bus list screen") {
xAnd("has favorite stops", "not implemented yet") {
Then("display list of bus with favorites on top") {
assertTrue(true)
}
}
And("has not favorite stops") {
Then("display list of bus") {
assertTrue(true)
}
}
}
When("enters bus detail screen") {
Then("display detailed bus stop") {
assertTrue(true)
}
}
}
}
})
```

## Summary

Contributions are welcome

0 comments on commit b64c32a

Please sign in to comment.