From 3acfb2c015df1af71db3bb16c26e01ffdd56962e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Sun, 3 Jun 2012 00:25:33 +0200 Subject: fix room specs to follow new particle reset policy --- spec/room_spec.rb | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/spec/room_spec.rb b/spec/room_spec.rb index c7cabd0..fb4c297 100644 --- a/spec/room_spec.rb +++ b/spec/room_spec.rb @@ -197,30 +197,22 @@ describe Iotas::Room do room0 = Iotas::Room.new 'room0', @spin door0 = Iotas::Door.new 'door0', room0 class Out < Iotas::Door - attr_reader :ps + attr_reader :count def receive_p p - @ps||=[] - @ps << p + @count||=0 + @count += 1 end end door1 = Out.new 'door1', room0 room0.add_link Iotas::Link.new('door0', 'door1') room0.add_link Iotas::Link.new('door0', 'door1', 'fields', 'f0,f1', 'v0v1') + room0.add_link Iotas::Link.new('door0', 'door1', 'fields', 'f0,f1', 'v0v2') p = @spin.require_p Iotas::Particle p['f0']='v0' p['f1']='v1' door0.send_p p @spin.spin! - door1.ps.length.should eql 2 - p0 = door1.ps[0] - p0.action.should be_nil - p0.src.should be door0 - p0.dst.should be_nil - p1 = door1.ps[1] - p1.action.should be_nil - p1.src.should be door0 - p1.dst.should be_nil - p1.should be p + door1.count.should eql 2 end # it "system route error: system no destination" do -- cgit v1.1-2-g2b99