Well, I'm exhausted. Exhausted in a sense run out of options.
We have Supervisor that manage an actor(s).
supervisor = Celluloid::SupervisionGroup.run!
airbrake = supervisor.pool(Flango::AirbrakeActor, as: :airbrake_actor, size: 1)
All I need to do is mock the airbrake actor which has a method notify_exception .. defined in it.
i.e the following call
airbrake.async.notify_exception('exception')
The relevant rspec code ...
expect(airbrake.async).to receive(:notify_exception).with('exception')
I have tried this.. Does not work
Tried the following approach (not sure what I'm doing)
airbrake = OpenStruct.new(:async, Flango::AirbrakeActor.new)
This work but the test hangs at the end and until killed.
Any help?
I was able to make it work after 2 changes.
One issue was that you were closing celluloid and then using dead variables. So i refactored startup code in init
And then refactored the
main_spec.rblike belowAnd now it works