The Artima Developer Community
Sponsored Link

ScalaTest/ScalaUtils Forum
Missing method in JMockCycle

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Ronualdo Augusto Maciel

Posts: 1
Nickname: ronualdo
Registered: Jul, 2011

Missing method in JMockCycle Posted: Jul 19, 2011 1:45 PM
Reply to this message Reply
Advertisement
Hello,

I'm a brazilian developer and this is my first post in the forum, so i apologize in advance for my bad english.

I've been using scalatest along with JMock and it's working quite well. I'm importing JMockCycle class the same way as the examples in the documentation:


val mockCollaborator = mock[Collaborator]


The problem is when i have to mock more then one instance of the same class inside the same test. In order to make this work in JMock, i've to use the Mockery.mock(Class clazz, String mockName).

The problem is that JMockCycle dont provide me any access to the method or any other method similar.

I've been looking in scalatest code, and it seems to me that should be something like that:


def mock[T <: AnyRef](implicit manifest: Manifest[T]) (mockName: String): T = {
context.mock(manifest.erasure.asInstanceOf[Class[T]], mockname)
}


Please, feel free to correct me if i said any nonsense.

Topic: Using a HavePropertyMatcher for collection elements? Previous Topic   Next Topic Topic: Documentation?

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use