On Apr 19, 2011, at 3:00 AM, Jarmo Pertman wrote:

> On Apr 18, 5:59 pm, David Chelimsky <dchelim...@gmail.com> wrote:
>> What do you think of within(n).seconds { ... }?
> 
> I'm not sure i understand it fully taking into account the examples
> above. Let me try to write them below:
> expect {
>    link.click
> }.to change {div.text}.from("before").to("after").within(2).seconds

OK - I think I understand this better from this example. The idea here is that 
the matcher should keep asking if div.text == "after" until it returns true or 
2 seconds have passed, whichever comes first, after which it fails. Correct? If 
so, then this is different from what I was envisioning with "within(2).seconds 
{ ... }"

I'm resistant to adding this because it opens up a lot of complications (like 
how to handle should_not, for one), so I'd prefer to see some experience with 
it first.

Have you looked at writing an extension gem that adds this behavior? I think 
that would be a great way to go with this, because users could just add a gem 
dependency and have access to it, and if it became widely used we could always 
talk about merging it later.

WDYT?

David
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to