github-actions[bot] on gh-pages
Publish javadoc/2.2-SNAPSHOT (compare)
leonard84 on master
Do not evaluate feature-skippin… (compare)
leonard84 on master
Bump org.gradle.test-retry from… (compare)
leonard84 on gradle
withVirtualTime
method, see https://www.baeldung.com/reactive-streams-step-verifier-test-publisher#3-testing-time-based-publishers as an example. Also you don't need VirtualTimeScheduler.getOrSet()
AFAIK.
class Testy extends Specification {
Helper helper = new Helper()
void "testy"() {
expect:
verify()
helper.verify()
}
void verify() {
assert 1 == 2
}
}
class Helper {
void verify() {
assert 1 == 3
}
}
class ClosureTest extends Specification {
Helper helper = new Helper()
void "testy"() {
expect:
verify.call()
}
}
class Helper {
Closure verify= { assert 1 == 2 }
}
runner {
parallel {
enabled true
defaultSpecificationExecutionMode ExecutionMode.SAME_THREAD
defaultExecutionMode ExecutionMode.SAME_THREAD
}
}
DESKTOP-CIDB3LU MINGW64 /e/projects/spock (master)
$ ./gradlew spock-core:test
Configure project :spock-core
[versioning] WARNING - the working copy has unstaged or uncommitted changes.
Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.8.3/userguide/command_line_interface.html#sec:command_line_warnings
BUILD SUCCESSFUL in 1s
5 actionable tasks: 5 up-to-date
A build scan was not published as you have not authenticated with server 'ge.spockframework.org'.
--no-build-cache
, or change some code locally
[[1,2,3], [4,5,6]].combinations()
# [[1, 4], [2, 4], [3, 4], [1, 5], [2, 5], [3, 5], [1, 6], [2, 6], [3, 6]]
[[1,2,3], [4,5,6]].combinations().sort()
# [[1, 4], [1, 5], [1, 6], [2, 4], [2, 5], [2, 6], [3, 4], [3, 5], [3, 6]]
[3, [1], [2], 1, [1,2], [1,1], [1,2,3], [1,2], 2, [1,2,2], [3]].sort()
# [1, 2, 3, [1], [2], [3], [1, 1], [1, 2], [1, 2], [1, 2, 2], [1, 2, 3]]
Hi all, I have a newbie question about Script bindings... I am running a test via the EmbeddedSpecRunner()
import spock.util.EmbeddedSpecRunner
def esr = new EmbeddedSpecRunner()
esr.runClass(SpockTestClass.class)
This is my groovy Script class. Before I run my Script I bind an instance of a class called myDsl
to it.
I would like to use myDsl
from within SpockTestClass but cannot figure out a way to supply it via the EmbeddedSpecRunner
I have tried creating a @Singleton and referencing it from within the Specification but I'm guessing classloaders stop me seeing this externally created .instance
How can I supply a pre-built Object(s) for use within a Specification?