Skip to content

Instantly share code, notes, and snippets.

@xconnecting
xconnecting / HeaderSpec.groovy
Created Feb 6, 2014
[Spock] Pancoc characterization test 3
View HeaderSpec.groovy
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 Feb 6, 2014
[Spock] Pancoc characterization test 2
View HeaderSpec.groovy
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 Feb 6, 2014
[Spock] Pancoc characterization test 1
View HeaderSpec.groovy
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 Jan 23, 2014
[Groovy] Exec command from Groovy script
View ExecCommand.groovy
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 Jan 23, 2014
[Spock] SampleSpec (Success)
View SampleSpec.groovy
import spock.lang.Specification
class SampleSpec extends Specification {
def "test sample"() {
expect:
def value = 2
value == 2
}
}
@xconnecting
xconnecting / SampleSpec.groovy
Created Jan 23, 2014
[Spock] SampleSpec (Fail)
View SampleSpec.groovy
import spock.lang.Specification
class SampleSpec extends Specification {
def "test sample"() {
expect:
def value = 1
value == 2
}
}
@xconnecting
xconnecting / build.gradle
Created Jan 23, 2014
[Gradle] build.gradle for Spock
View build.gradle
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 Jan 1, 2016
[Gradle] Install eclipse and eclipse plugins
View build.gradle
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()
View build.gradle
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'
}
View mybook.md

% タイトル
% 作者


language: ja-JP

見出し1

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