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

Incorporate the timeout examples gist into specs2 #322

Closed
ittaiz opened this issue Jan 20, 2015 · 5 comments
Closed

Incorporate the timeout examples gist into specs2 #322

ittaiz opened this issue Jan 20, 2015 · 5 comments

Comments

@ittaiz
Copy link
Contributor

ittaiz commented Jan 20, 2015

Hi,
I just google'd how to timeout an example (like JUnit timeout on @test) and saw your gist.
My question is why not incorporate it into the library?
It's pretty obvious people want it since you created the gist from people's requests (also surfaced in the specs2 google group) and now people have to copy paste this gist into their code causing code duplication and handling something which is, IMO, more in the library scope then in the user's scope.

I'm mainly talking about the "upTo" method BTW

@etorreborre
Copy link
Owner

I have actually added it to the next specs2 major version.

There will also be some control over the execution model which already has a notion of timeout built-in, so you can write:

class TestSpec extends Specification { def is = s2"""
 test $e1
"""

  def e1 = Execution.result {
    Thread.sleep(2000)
    ok
  }.setTimeout(1.seconds)
}

@ittaiz
Copy link
Contributor Author

ittaiz commented Jan 22, 2015

Excellent, thanks.
Any chance for a back port of just the trait?

‏בתאריך יום חמישי, 22 בינואר 2015, Eric Torreborre notifications@github.com
כתב:

I have actually added it to the next specs2 major version
https://github.com/etorreborre/specs2/blob/specs2-three/matcher-extra/src/main/scala/org/specs2/specification/ExamplesTimeout.scala
.

There will also be some control over the execution model which already has
a notion of timeout built-in, so you can write:

class TestSpec extends Specification { def is = s2""" test $e1"""

def e1 = Execution.result {
Thread.sleep(2000)
ok
}.setTimeout(1.seconds)
}


Reply to this email directly or view it on GitHub
#322 (comment).

@etorreborre
Copy link
Owner

Just a matter of time... I'll try to do that next week (moving houses this week).

@etorreborre
Copy link
Owner

This is published as 2.4.16-SNAPSHOT.

@ittaiz
Copy link
Contributor Author

ittaiz commented Jan 22, 2015

You rock, thanks!

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