Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Divide Before and After callbacks from Given #4

Open
mike-neck opened this issue Apr 29, 2020 · 0 comments
Open

Divide Before and After callbacks from Given #4

mike-neck opened this issue Apr 29, 2020 · 0 comments

Comments

@mike-neck
Copy link
Owner

DIvide Given<C,G> into

  • Given<C, G>
  • Before<C>
  • After<C>

with methods

interface BeforeCallback<C, G> {
  infix operator fun plus(given: Given<C, G>): Given<C,G>
}

interface Given<C,G> {
  infix operator fun plus(after: After<C>): Given<C, G>
}

and make dsl like

object ExampleSpec: KtCheck
by Before<C>({ C() }) +
  Given<C, G>({ makeG() })
  .When<C,G,W>({ makeW(it) })
  .Then<C,G,W>({ _, r -> r shouldBe something() }) +
  After<C>({ tearDown() })
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant