Aman,
There is an unresolved issue with the patch I contributed to, namely,
that test failures inside any EM block, such as EM.add_timer, etc.
fail the entire rspec process and prevent any further examples from
running. I have a solution for this that also replaces all of the
monkey patching of rspec's internals with an overloaded #instance_eval
and also eliminates the use of globals.
This patch is mostly ready to go, but I'd like to ask about your API
preference first (any lurkers who are interested, chime in!):
1) The cleanest way is something like
describe MyEventedCode, "when using EventMachine" do
include EMSpec
...
end
2) If you have a strong preference for the EM.rspec MyEventedCode
style API, I can make it happen but this requires a bunch of monkey
patching and excess code just to handle the case where the rspec
example is not using EM and doesn't call #done, because EM specific
code is loaded into rspec globally.
Opinions?
Thanks,
Dan
p.s., patch so far is here, I deleted and re-forked:
http://github.com/danielsdeleo/em-spec/tree/master