Skip to content

Commit f908a75

Browse files
committed
Be consistent about tests showing expected behavior
… even if it is undesirable or incorrect.
1 parent f1e6aa9 commit f908a75

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

groovylang-support/javamoney-spock/src/test/groovy/UnmodifiedJavaMoneyBehaviorSpec.groovy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import javax.money.NumberValue
1616
*
1717
* { @code def sum = amount1 + amount2 }
1818
*
19-
* Perhaps undesirable (buggy?) behavior should be indicated by a failing test,
20-
* but for now the tests are written to "specify" the undersirable behavior with
19+
* Perhaps undesirable behavior should be indicated by a failing test,
20+
* but for now the tests are written to "specify" the undesirable behavior with
2121
* asserts in the "then" clauses.
2222
*/
2323
class UnmodifiedJavaMoneyBehaviorSpec extends Specification {
@@ -57,14 +57,14 @@ class UnmodifiedJavaMoneyBehaviorSpec extends Specification {
5757
sum.class == Integer.class
5858
}
5959
60-
def "Add number values using Groovy + operator gives accurate result" () {
60+
def "Add number values using Groovy + operator incorrectly rounds to integer result" () {
6161
when: "We add two NumberValues using the '+' operator and the Groovy Number.plus() method"
6262
NumberValue value1 = Money.of(10, "USD").number
6363
NumberValue value2 = Money.of(0.99, "USD").number
6464
def sum = value1 + value2
6565
66-
then: "We get a correct answer"
67-
sum == 10.99
66+
then: "We get an incorrect answer - rounded to Integer"
67+
sum == 10.00 // TODO: Fix this with either upstream changes and/or Groovy category
6868
}
6969
7070
def "Add number values and convert from Integer to new NumberValue" () {

0 commit comments

Comments
 (0)