paulbutcher/ScalaMock — Issue #12: generate-mock is successful but test fails
Author: takezoe
Created: 2012-02-29 20:06:42+00:00
State: open

I'm trying ScalaMock 2.2 with Scala 2.9.1 and sbt 0.11.2 according to the procedure of the following entry:
http://www.paulbutcher.com/2011/11/scalamock-step-by-step/

I could generate mock sources by "sbt generate-mocks" into target/scala-2.9.1/src_managed, but I can't run "sbt test" because test compilation is failed.

C:\scalamock-test>sbt test
[info] Loading global plugins from C:\Users\takezoe\.sbt\plugins
[info] Loading project definition from C:\scalamock-test\project\project
[info] Loading project definition from C:\scalamock-test\project
[info] Set current project to scalamock-test (in build file:/C:/scalamock-test/)
[info] Compiling 2 Scala sources to C:\scalamock-test\target\scala-2.9.1\test-classes...
[error] C:\scalamock-test\src\test\scala\jp\sf\amateras\scala\test\scalamock\ScalaMockTest.scala:5: object generated is not a member of package org.scalamock
[error] import org.scalamock.generated.GeneratedMockFactory
[error] ^
[error] C:\scalamock-test\src\test\scala\jp\sf\amateras\scala\test\scalamock\ScalaMockTest.scala:12: not found: value mock
[error] val helloworld = mock[HelloWorld]
[error] ^
[error] C:\scalamock-test\src\test\scala\jp\sf\amateras\scala\test\scalamock\ScalaMockTest.scala:21: not found: value mockObject
[error] val util = mockObject(StringUtils)
[error] ^
[error] three errors found
[error] {file:/C:/scalamock-test/}scalamock-test/test:compile: Compilation failed
[error] Total time: 2 s, completed 2012/03/01 4:57:43

It seems compiler does not see src_managed but I can't understand why...