Skip to content

Instantly share code, notes, and snippets.

View ldaley's full-sized avatar

Luke Daley ldaley

View GitHub Profile
Spock For Non-Believers
Which code would you rather want to read, write, and maintain? Choose the right answer and win a trip to Vulcan!
A. B.
/* Seven lines of imports removed for clarity */ /* Zero lines of imports removed for clarity */
@RunWith(Parameterized.class) class HelloSpock extends spock.lang.Specification {
public class HelloSpock { def "length of Spock and friends"() {
<html>
<head>
</head>
<body>
<div class="spec">
<div class="details">
<div class="name">My first spec</div>
<div class="duration">3 mins 17 seconds</div>
<div class="result">fail</div>
</div>
<html>
<head>
</head>
<body>
<div class="spec pass/some-fail/fail first/last odd/even" id="«spec-class-name»">
<div class="details">
<div class="name">My first spec</div>
<div class="duration">3 mins 17 seconds</div>
<div class="result">fail</div>
</div>
@ldaley
ldaley / gist:1486177
Created December 16, 2011 14:12 — forked from robfletcher/gist:1486156
Geb module methods demonstrating how to wait for jQuery animation to complete
void next() {
nextButton.click()
waitForAnimationComplete()
}
private void waitForAnimationComplete() {
waitFor { this.jquery."find(':animated').length == 0" }
}
buildscript {
repositories {
maven { url "http://oss.jfrog.org/repo" }
mavenCentral()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:0.9.7'
}
}
buildscript {
repositories {
maven { url "http://oss.jfrog.org/repo" }
mavenCentral()
}
dependencies {
classpath 'io.ratpack:ratpack-gradle:0.9.7'
}
}