Dossy [mailto:dossy / panoptic.com] wrote: > I did try using the timeout extension, but this just doesn't > seem to work: > > timeout(@timeout) { send(@method_name) } > > I'm busy right now, so wrapping my mind around why it isn't > working will have to wait until later. It's probably > something simple, but I'm having a stupid moment right now. The timeout call should block until the send either finishes, or passes the timeout value. If the latter, the exception will fire. What's happening when you run it? Are you expecting the call to be non-blocking? > I thought about writing a new assertion as well, but didn't > know if that was "okay" or not. I'm too used to open sourced > projects where getting changes to the "core" is a long, > uphill battle, so I'm used to having to write extensions that > don't touch the core. > > Of course, I just realized yet another reason why Ruby rules > ... I can extend the core without having to actually touch > any of its files -- aah! I'm going to write an assert_xpath > assertion to make my REXML-using test cases easier to write! > God, this is great! I know... isn't it? It's completely ruined my enjoyment when coding Java. > I guess we could implement #assert_takes_nowait that has a > timeout and all of my code can be thrown away. :-) What do > you think? It sounds like I'm not the only one who finds this useful, so I'm going to add it to the TODO (which is getting rather long lately). Thanks for your input. > Nathaniel, I've posted my code (and unit tests) to this URL: > > http://panoptic.com/ruby You're a step ahead of me... I hadn't written tests for mine yet :-/ That's the only problem with Ruby - it's so easy to write, if you're not careful you can end up writing the code before you realize there isn't a test for it. At least that's how I rationalize it :-) BTW, your code makes me realize that we need better decorator support in the framework, both implicit (as proposed earlier by Dave) and explicit. I'll add that to the TODO as well. Nathaniel <:((>< + - - | RoleModel Software, Inc. | EQUIP VI