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
import spock.lang.* | |
class MySpec extends Specification { | |
def "should size list return always 3"() { | |
given: | |
List list = Stub() | |
list.size() >> 3 | |
expect: |
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
import spock.lang.* | |
class MySpec extends Specification { | |
def "should return 1,2,3 respectively when calling size list"() { | |
given: | |
List list = Stub() | |
list.size() >>> [1,2,3] | |
expect: |
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
import spock.lang.* | |
class MySpec extends Specification { | |
def "should return 2 for method parameter equal to 2"() { | |
given: | |
List list = Stub() | |
list.get(0) >> 0 | |
list.get(1) >> { throw new IllegalArgumentException() } | |
list.get(2) >> 2 |
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
dependencies { | |
testCompile group: 'org.spockframework', name: 'spock-core', version: '1.0-groovy-2.4' | |
} |
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
<dependency> | |
<groupId>org.spockframework</groupId> | |
<artifactId>spock-core</artifactId> | |
<version>1.0-groovy-2.4</version> | |
</dependency> |
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
import spock.lang.* | |
class MySpec extends Specification { | |
def starshipName = 'NCC-1701' | |
def "size method should be executed three times"() { | |
given: | |
List list = Mock() | |
when: |
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
@Grab('io.ratpack:ratpack-groovy:1.8.0') | |
import static ratpack.groovy.Groovy.ratpack | |
import static ratpack.jackson.Jackson.json | |
import groovy.json.JsonSlurper | |
def parser = new JsonSlurper() | |
ratpack { | |
handlers { |
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
plugins { | |
// Apply the Kotlin JVM plugin to add support for Kotlin on the JVM | |
kotlin("jvm").version("1.3.10") | |
application | |
} | |
repositories { | |
// Use jcenter for resolving your dependencies. | |
// You can declare any Maven/Ivy/file repository here. |
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
-- Marc Balmer [email protected] via lists.lua.org | |
-- $ lua luacc.lua -o luacc luacc.lua | |
local outfile = 'luacc.out' | |
local strip = false | |
for k, v in pairs(arg) do | |
if v == '-o' then | |
outfile = arg[k + 1] | |
arg[k] = '' |
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
#!/bin/bash | |
set -e | |
sleep_seconds=2 | |
function usage() { | |
echo "Usage: ./wait <tcp/http> <host>:<port>" | |
} |