Spock rightShift (mocking) operator apparently not working
You're attempting to use multiple levels of indirection, and the >>
is getting applied to the result of .attributes["favcolor"]
, which is null (since .attributes
is an empty map). Instead, just initialize the map:
fizzBuzz.attributes >> [favcolor: 'red', age: 36]
(Also, did you really mean age
to be a string?)