Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.2, 1.8.3, 1.8.4
-
None
Description
Trying to mock or stub an abstract class fails as of groovy 1.8.2 and later (this
works under 1.7.10, 1.8.0, and 1.8.1). This code
import groovy.mock.interceptor.MockFor MockFor.getInstance(URLConnection, new URL('http://foo'))
results in
Caught: BUG! exception in phase 'class generation' in source unit 'Script1.groovy' SpreadExpression should not be visited here BUG! exception in phase 'class generation' in source unit 'Script1.groovy' SpreadExpression should not be visited here
The breakage was possibly introduced by the fix for GROOVY-4968.
Also note that this may be related to GROOVY-4255, though I'd expect MockFor and StubFor
to work irrespective of the status of that bug.