Skip to content

Instantly share code, notes, and snippets.

@xconnecting
xconnecting / HeaderSpec.groovy
Created February 6, 2014 05:01
[Spock] Pancoc characterization test 3
import spock.lang.Specification
class HeaderSpec extends Specification {
def "header characterization test"() {
when:
def proc = "pandoc header.md -o header.html".execute()
proc.waitFor()
then:
def result = new File("header.html").getText('UTF-8')
"""<h1 id="header-test">Header Test</h1>
@xconnecting
xconnecting / HeaderSpec.groovy
Created February 6, 2014 05:01
[Spock] Pancoc characterization test 2
import spock.lang.Specification
class HeaderSpec extends Specification {
def "header characterization test"() {
when:
def proc = "pandoc header.md -o header.html".execute()
proc.waitFor()
then:
def result = new File("header.html").getText('UTF-8')
"""<h1 id="header-test">Header Test</h1>
@xconnecting
xconnecting / HeaderSpec.groovy
Created February 6, 2014 05:00
[Spock] Pancoc characterization test 1
import spock.lang.Specification
class HeaderSpec extends Specification {
def "header characterization test"() {
when:
def proc = "pandoc header.md -o header.html".execute()
proc.waitFor()
then:
def result = new File("header.html").getText('UTF-8')
"" == result
@xconnecting
xconnecting / ExecCommand.groovy
Created January 23, 2014 05:24
[Groovy] Exec command from Groovy script
def proc = "pandoc -v".execute()
proc.waitFor()
println proc.in.text
// if you just want stdout of the command, you can write as:
println "pandoc -v".execute().text
@xconnecting
xconnecting / SampleSpec.groovy
Created January 23, 2014 02:16
[Spock] SampleSpec (Success)
import spock.lang.Specification
class SampleSpec extends Specification {
def "test sample"() {
expect:
def value = 2
value == 2
}
}
@xconnecting
xconnecting / SampleSpec.groovy
Created January 23, 2014 02:15
[Spock] SampleSpec (Fail)
import spock.lang.Specification
class SampleSpec extends Specification {
def "test sample"() {
expect:
def value = 1
value == 2
}
}
@xconnecting
xconnecting / build.gradle
Created January 23, 2014 01:52
[Gradle] build.gradle for Spock
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
repositories { mavenCentral() }
dependencies {
compile "org.codehaus.groovy:groovy-all:2.0.7"
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
}
@xconnecting
xconnecting / build.gradle
Last active January 1, 2016 12:19
[Gradle] Install eclipse and eclipse plugins
project.ext.tempDir = 'tmp'
project.ext.targetEclipseDir = 'd:/eclipseGroovy'
ant.condition(property: "os", value: "windows") { os(family: "windows") }
ant.condition(property: "os", value: "unix" ) { os(family: "unix") }
task clean << { delete 'tmp' }
task installEclipse << {
new File(tempDir).mkdirs()
apply plugin: 'java'
apply plugin: 'groovy'
apply plugin: 'eclipse'
repositories { mavenCentral() }
dependencies {
compile "org.codehaus.groovy:groovy-all:2.0.7"
testCompile 'org.spockframework:spock-core:0.7-groovy-2.0'
}

% タイトル
% 作者


language: ja-JP

見出し1

見出し1です。試しに書いてみます。