This file contains hidden or 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
| @RetryOnFailure(times=3, delaySeconds=2) | |
| class MagicSpecification extends Specification { | |
| def setup() { | |
| prepareBlackWand() | |
| } | |
| } |
This file contains hidden or 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
| class FlakyMagicSpec extends Specification { | |
| @RetryOnFailure(times=3, delaySeconds=2) | |
| def "magic should happen"() { | |
| when: | |
| flakyMagicIsRequested() | |
| then: | |
| magicHasHappened() | |
| } | |
| } |
This file contains hidden or 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
| class FlakyMagicSpec extends Specification { | |
| @RetryOnFailure | |
| def "magic should happen"() { | |
| when: | |
| flakyMagicIsRequested() | |
| then: | |
| magicHasHappened() | |
| } | |
| } |
This file contains hidden or 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
| Fairy fairy = Fairy.create() | |
| NetworkProducer fakeNetwork = fairy.networkProducer() | |
| def "Nevermind Fairy all I need is a wifi"() { | |
| log.info(fakeNetwork.ipAddress()) | |
| } |
This file contains hidden or 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
| Fairy fairy = Fairy.create() | |
| Company fakeCompany = fairy.company() | |
| def "Fairy please give me a startup idea"() { | |
| log.info(fakeCompany.name) | |
| log.info(fakeCompany.email) | |
| log.info(fakeCompany.domain) | |
| log.info(fakeCompany.url) | |
| log.info(fakeCompany.vatIdentificationNumber) | |
| } |
This file contains hidden or 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
| Fairy fairy = Fairy.create() | |
| Person girl = fairy.person( | |
| PersonProperties.female(), | |
| PersonProperties.ageBetween(20, 30) | |
| ) | |
| def "dear Fairy this time give me a girl please"() { | |
| log.info("$girl.firstName $girl.lastName") | |
| log.info("$girl.age") |
This file contains hidden or 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
| Fairy fairy = Fairy.create() | |
| Person person = fairy.person() | |
| def "Fairy please send me someone not just anyone"() { | |
| log.info(person.firstName) | |
| log.info(person.lastName) | |
| log.info(person.address.addressLine1) | |
| log.info(person.address.addressLine2) | |
| log.info(person.email) | |
| } |
This file contains hidden or 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
| tresc |
This file contains hidden or 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
| def setupSpec() { | |
| setDefaultPollInterval(fibonacci()) | |
| setDefaultPollDelay(Duration.ONE_HUNDRED_MILLISECONDS) | |
| setDefaultTimeout(Duration.FIVE_SECONDS) | |
| } |
This file contains hidden or 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
| static pollForDeals(dealId) { | |
| await().until({ | |
| getDeal(dealId), not(equalTo(404)) | |
| }) | |
| } | |
| static getDeal(dealId) { | |
| def response = | |
| when() | |
| .get("deal/$dealId") |
NewerOlder