close on next reactor tick if not connected, updated specs for rspec 3