Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

timeout for mock calls #214

Closed
cyberb opened this issue Nov 15, 2013 · 3 comments
Closed

timeout for mock calls #214

cyberb opened this issue Nov 15, 2013 · 3 comments
Milestone

Comments

@cyberb
Copy link

cyberb commented Nov 15, 2013

In mockito there is VerificationWithTimeout which allows to wait for expected calls on a mock but it is not exposed in specs2.
Also there is an eventually function, but I think it is not possible to apply to mocks.

It would be nice to be able to do something like this:

there was one(mock).method.eventually

Thanks.

@etorreborre
Copy link
Owner

Hi Boris, can you please have a look at the latest specs2-mock-2.4-SNAPSHOT jar (just put this jar before anything else on the classpath)? The syntax is:

there was after(100.millis).one(mock).method

@cyberb
Copy link
Author

cyberb commented Nov 19, 2013

Hi, I am using maven with this dependency;

<dependency>
  <groupId>org.specs2</groupId>
  <artifactId>specs2_2.10</artifactId>
  <version>2.4-SNAPSHOT</version>
  <scope>test</scope>
</dependency>

And I do not see any changes in CalledMatchers

Do you have anything in maven central/sonatype to try?
Thanks.

@cyberb
Copy link
Author

cyberb commented Nov 19, 2013

Sorry, just found it:

<dependency>
  <groupId>org.specs2</groupId>
  <artifactId>specs2-mock_2.10</artifactId>
  <version>2.4-SNAPSHOT</version>
  <scope>test</scope>
</dependency>

Works, cool, thank you!
Do you plan a full release with this feature?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants