Skip to content

Commit

Permalink
GROOVY-10093
Browse files Browse the repository at this point in the history
  • Loading branch information
eric-milles committed May 18, 2021
1 parent 50e0e97 commit 75b9406
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 19 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -98,21 +98,18 @@ private IPath[] createSimpleProject(final String name, final boolean isGroovy) t
}

private void addJUnitAndSpock(final IPath projectPath) throws Exception {
int jUnitVersion = 4;
String spockCorePath;
if (isAtLeastGroovy(30)) {
jUnitVersion = 5;
spockCorePath = "lib/spock-core-2.0-M4-groovy-3.0.jar";
if (!isAtLeastGroovy(30)) {
spockCorePath = "lib/spock-core-2.0-groovy-2.5.jar";
env.addJar(projectPath, "lib/spock-groovy2-compat-2.0.jar");
} else {
spockCorePath = "lib/spock-core-2.0-groovy-3.0.jar";
if (isAtLeastGroovy(40)) {
System.setProperty("spock.iKnowWhatImDoing.disableGroovyVersionCheck", "true");
}
} else {
spockCorePath = "lib/spock-core-1.3-groovy-2.5.jar";
}
env.addJar(projectPath, spockCorePath);

env.addEntry(projectPath, JavaCore.newContainerEntry(
new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/" + jUnitVersion)));
env.addEntry(projectPath, JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/5")));
}

// check whether these are identical (in everything except name!)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2009-2020 the original author or authors.
* Copyright 2009-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -29,12 +29,13 @@ public final class SpockInferencingTests extends InferencingTestSuite {
public void setUp() throws Exception {
String spockCorePath;
if (isAtLeastGroovy(30)) {
spockCorePath = "lib/spock-core-2.0-M4-groovy-3.0.jar";
spockCorePath = "lib/spock-core-2.0-groovy-3.0.jar";
} else {
spockCorePath = "lib/spock-core-1.3-groovy-2.5.jar";
spockCorePath = "lib/spock-core-2.0-groovy-2.5.jar";
env.addJar(project.getFullPath(), "lib/spock-groovy2-compat-2.0.jar");
}
env.addJar(project.getFullPath(), spockCorePath);
env.addEntry(project.getFullPath(), JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/4")));
env.addEntry(project.getFullPath(), JavaCore.newContainerEntry(new Path("org.eclipse.jdt.junit.JUNIT_CONTAINER/5")));
}

@Test
Expand Down Expand Up @@ -129,7 +130,7 @@ public void testPropertyCheck() {
assertType(source, offset, offset + 3, "java.lang.Integer");
}

@Test @Ignore("see #814") // https://github.com/groovy/groovy-eclipse/issues/812
@Test @Ignore("see #814") // https://github.com/groovy/groovy-eclipse/issues/814
public void testDataTableChecks() {
//@formatter:off
String source =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
<dependency>
<groupId>org.spockframework</groupId>
<artifactId>spock-core</artifactId>
<version>2.0-M4-groovy-3.0</version>
<version>2.0-groovy-3.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,27 @@
setPreferences=true
indentendOnly=false
###src
class Issue1219 extends spock.lang.Specification {
void 'test'() {
class SpockTests extends spock.lang.Specification {
void "issue 1219"() {
expect:
[] == []
toString()
}
void "issue 1258"() {
expect:
[] == []
}
}
###exp
class Issue1219 extends spock.lang.Specification {
void 'test'() {
class SpockTests extends spock.lang.Specification {
void "issue 1219"() {
expect:
[] == []
toString()
}
void "issue 1258"() {
expect:
[] == []
}
}
###end

0 comments on commit 75b9406

Please sign in to comment.