class MyFirstSpec extends Specification {
def "let's try this!"() {
expect:
Math.max(1, 2) == 3
}
}
MyFirstSpec
- let's try this! FAILED
Condition not satisfied:
Math.max(1, 2) == 3
| |
2 false
at MyFirstSpec.let's try this!(Script1.groovy:7)
class MathSpec extends Specification {
@Unroll
def "maximum of #a and #b should be #c" {
expect:
Math.max(a, b) == c
where:
a | b | c
1 | 3 | 3
7 | 4 | 4
0 | 0 | 0
}
}
Android Tests (JUnit 3)
Scrafice speed for reliability and ease of setup.
Steps
Include the Jar Figure out why it's not running Fix it ReleaseAndroid Test Kit would run OptimizeRunOrderSuite
Fix: Created custom test runner ignoring everything in the spock package.
IT WORKS!
class AndroidTestSpec extends Specification {
def "this should run on Android!"() {
given:
def a = 2
def b = 3
when:
def result = a + b
then:
result == 5
}
}