Test now checks that we get 'ready!' from em-bitcoin to the actor
This commit is contained in:
@@ -35,13 +35,20 @@ class MockActor
|
||||
end
|
||||
|
||||
def ready!
|
||||
log(:info, "Received ready! call from em-bitcoin")
|
||||
@ready = true
|
||||
@on_ready.call
|
||||
end
|
||||
|
||||
def ready?
|
||||
@ready == true
|
||||
end
|
||||
|
||||
# triggers for various events
|
||||
def on_ready(&blk)
|
||||
@on_ready = blk
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
attr_accessor :name
|
||||
@@ -85,13 +92,11 @@ describe BitcoinClient do
|
||||
start_server
|
||||
start_client
|
||||
|
||||
done
|
||||
@client_actor.on_ready do
|
||||
@client_actor.connection.should_not == nil
|
||||
done
|
||||
end
|
||||
|
||||
# EM::add_periodic_timer(2) do
|
||||
# @client_actor.should_receive(:ready!).and_return(true)
|
||||
# @client_actor.should_receive(:connection=).with(@client).and_return(true)
|
||||
# done
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user