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
|
end
|
||||||
|
|
||||||
def ready!
|
def ready!
|
||||||
|
log(:info, "Received ready! call from em-bitcoin")
|
||||||
@ready = true
|
@ready = true
|
||||||
|
@on_ready.call
|
||||||
end
|
end
|
||||||
|
|
||||||
def ready?
|
def ready?
|
||||||
@ready == true
|
@ready == true
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# triggers for various events
|
||||||
|
def on_ready(&blk)
|
||||||
|
@on_ready = blk
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
attr_accessor :name
|
attr_accessor :name
|
||||||
@@ -85,13 +92,11 @@ describe BitcoinClient do
|
|||||||
start_server
|
start_server
|
||||||
start_client
|
start_client
|
||||||
|
|
||||||
|
@client_actor.on_ready do
|
||||||
|
@client_actor.connection.should_not == nil
|
||||||
done
|
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
|
end
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user