1
1
package com.lookout.jruby
2
2
3
- import org.gradle.api.artifacts.Configuration
4
- import org.gradle.api.artifacts.repositories.ArtifactRepository
5
3
import org.gradle.testfixtures.ProjectBuilder
6
- import spock.lang.FailsWith
7
- import spock.lang.Ignore
8
- import spock.lang.IgnoreIf
9
- import spock.lang.IgnoreRest
10
- import spock.lang.Specification
11
- import spock.lang.Stepwise
4
+ import spock.lang.*
12
5
13
6
import static org.gradle.api.logging.LogLevel.LIFECYCLE
14
7
15
8
/**
16
9
* @author Schalk W. Cronjé
17
10
*/
18
11
class JRubyExecExtensionIntegrationSpec extends Specification {
19
-
20
- static final boolean TESTS_ARE_OFFLINE = true
21
- // static final boolean TESTS_ARE_OFFLINE = System.getProperty('TESTS_ARE_OFFLINE') != null
12
+
13
+ static final boolean TESTS_ARE_OFFLINE = System . getProperty(' TESTS_ARE_OFFLINE' ) != null
22
14
static final File TEST_SCRIPT_DIR = new File ( System . getProperty(' TEST_SCRIPT_DIR' ) ?: ' src/integTest/resources/scripts' )
23
15
static final File TESTROOT = new File (" ${ System.getProperty('TESTROOT') ?: 'build/tmp/test/integration-tests'} /jreeis" )
24
16
@@ -38,19 +30,18 @@ class JRubyExecExtensionIntegrationSpec extends Specification {
38
30
}
39
31
}
40
32
41
-
42
33
@IgnoreIf ({TESTS_ARE_OFFLINE })
43
34
def " Run a script with minimum parameters" () {
44
35
given :
45
36
def output = new ByteArrayOutputStream ()
46
37
47
- when :
38
+ when : " I call jrubyexec with only a script name "
48
39
project. jrubyexec {
49
40
script " ${ TEST_SCRIPT_DIR} /helloWorld.rb"
50
41
standardOutput output
51
42
}
52
43
53
- then :
44
+ then : " I expect the Ruby script to be executed "
54
45
output. toString() == " Hello, World\n "
55
46
}
56
47
0 commit comments