Skip to content

Instantly share code, notes, and snippets.

@sullivan-
Created February 6, 2013 16:20
Show Gist options
  • Save sullivan-/4723717 to your computer and use it in GitHub Desktop.
Save sullivan-/4723717 to your computer and use it in GitHub Desktop.
import org.easymock.EasyMock.reset
import org.scalatest.FlatSpec
class UserServiceSpec
extends FlatSpec
with ComponentRegistryMock
with UserServiceComponentImpl {
behavior of "UserServiceImpl.create"
it should "delegate to UserRepository.create" in {
val user = User("charlie", "swordfish")
expecting {
userRepository.create(user)
}
whenExecuting(userRepository) {
userService.create(user.username, user.password)
}
reset(userRepository)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment