File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
groovylang-support/javamoney-spock/src/test/groovy Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff 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 */
2323class 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 " () {
You can’t perform that action at this time.
0 commit comments