diff options
| author | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-02 22:27:39 +0200 | 
|---|---|---|
| committer | Jérémy Zurcher <jeremy@asynk.ch> | 2012-06-02 22:27:39 +0200 | 
| commit | f5b688def06400c2ecff070142dc0de8bb41cf5b (patch) | |
| tree | bd655732e50215c76f7614ed400055f0ff346211 /spec | |
| parent | 4df07172fef440f24945149b2490c0c60e72e72e (diff) | |
| download | edoors-ruby-f5b688def06400c2ecff070142dc0de8bb41cf5b.zip edoors-ruby-f5b688def06400c2ecff070142dc0de8bb41cf5b.tar.gz | |
specs cover direc routing throug send_p action parameter
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/room_spec.rb | 27 | 
1 files changed, 23 insertions, 4 deletions
| diff --git a/spec/room_spec.rb b/spec/room_spec.rb index 98f2e49..c7cabd0 100644 --- a/spec/room_spec.rb +++ b/spec/room_spec.rb @@ -58,7 +58,7 @@ describe Iotas::Room do          r4.search_down('dom0/r0/r1/r2').should be nil      end      # -    it "routing success (direct)" do +    it "routing success (direct add_dst)" do          room0 = Iotas::Room.new 'room0', @spin          door0 = Iotas::Door.new 'door0', room0          p = @spin.require_p Iotas::Particle @@ -69,6 +69,16 @@ describe Iotas::Room do          p.dst.should be door0      end      # +    it "routing success (direct send)" 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' +        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 @@ -205,11 +215,11 @@ describe Iotas::Room do          p0 = door1.ps[0]          p0.action.should be_nil          p0.src.should be door0 -        p0.dst.should be door1 +        p0.dst.should be_nil          p1 = door1.ps[1]          p1.action.should be_nil          p1.src.should be door0 -        p1.dst.should be door1 +        p1.dst.should be_nil          p1.should be p      end      # @@ -230,7 +240,7 @@ describe Iotas::Room do          p.dst.should be room0.spin      end      # -    it "system routing success" do +    it "system routing success (add_dst)" do          room0 = Iotas::Room.new 'room0', @spin          door0 = Iotas::Door.new 'door0', room0          p = @spin.require_p Iotas::Particle @@ -240,6 +250,15 @@ describe Iotas::Room do          p.dst.should be door0      end      # +    it "system routing success (send_sys_p)" do +        room0 = Iotas::Room.new 'room0', @spin +        door0 = Iotas::Door.new 'door0', room0 +        p = @spin.require_p Iotas::Particle +        door0.send_sys_p p, Iotas::SYS_ACT_ADD_LINK +        p.action.should eql Iotas::SYS_ACT_ADD_LINK +        p.dst.should be door0 +    end +    #      it "SYS_ACT_ADD_LINK" do          room0 = Iotas::Room.new 'room0', @spin          door0 = Iotas::Door.new 'door0', room0 | 
