From 4bf831d32813f9389f1fa6c8edcda2bd84143af9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 3 Jun 2012 11:17:14 +0200 Subject: specs: add direct routing through path specs --- spec/room_spec.rb | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/spec/room_spec.rb b/spec/room_spec.rb index fb4c297..de4b55e 100644 --- a/spec/room_spec.rb +++ b/spec/room_spec.rb @@ -69,7 +69,7 @@ describe Iotas::Room do p.dst.should be door0 end # - it "routing success (direct send)" do + it "routing success (direct send to self)" do room0 = Iotas::Room.new 'room0', @spin door0 = Iotas::Door.new 'door0', room0 p = @spin.require_p Iotas::Particle @@ -79,6 +79,26 @@ describe Iotas::Room do p.dst.should be door0 end # + it "routing success (direct send to pointer)" do + room0 = Iotas::Room.new 'room0', @spin + door0 = Iotas::Door.new 'door0', room0 + p = @spin.require_p Iotas::Particle + p.init! Fake.new( 'fake', @spin) + door0.send_p p, 'get', door0 + p.action.should eql 'get' + p.dst.should be door0 + end + # + it "routing success (direct send to path)" do + room0 = Iotas::Room.new 'room0', @spin + door0 = Iotas::Door.new 'door0', room0 + p = @spin.require_p Iotas::Particle + p.init! Fake.new( 'fake', @spin) + door0.send_p p, 'get', door0.path + p.action.should eql 'get' + p.dst.should be door0 + end + # it "routing success through Spin@world" do room0 = Iotas::Room.new 'room0', @spin room1 = Iotas::Room.new 'room1', room0 -- cgit v1.1-2-g2b99