-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from agourlay/0.8.0
0.8.0
- Loading branch information
Showing
60 changed files
with
1,999 additions
and
724 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/it/scala/com.github.agourlay.cornichon.examples/DeckOfCard.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.github.agourlay.cornichon.examples | ||
|
||
import com.github.agourlay.cornichon.CornichonFeature | ||
import scala.concurrent.duration._ | ||
|
||
//see http://deckofcardsapi.com/ | ||
class DeckOfCard extends CornichonFeature { | ||
|
||
override lazy val baseUrl = "http://deckofcardsapi.com/api" | ||
|
||
def feature = | ||
Feature("Deck of Card API") { | ||
|
||
Scenario("draw any king") { | ||
|
||
Given I get("/deck/new/shuffle/?deck_count=1").withParams( | ||
"deck_count" -> "1" | ||
) | ||
|
||
Then assert status.is(200) | ||
|
||
And I save_body_path("deck_id" -> "deck-id") | ||
|
||
Eventually(maxDuration = 10.seconds, interval = 10.millis) { | ||
|
||
When I get("/deck/<deck-id>/draw/") | ||
|
||
And assert status.is(200) | ||
|
||
Then assert body.path("cards[0].value").is("KING") | ||
|
||
} | ||
} | ||
|
||
// Idea: implement blackjack game :) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.