summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/edoors/room.rb2
-rw-r--r--spec/room_spec.rb11
2 files changed, 7 insertions, 6 deletions
diff --git a/lib/edoors/room.rb b/lib/edoors/room.rb
index decdb83..46eb6b4 100644
--- a/lib/edoors/room.rb
+++ b/lib/edoors/room.rb
@@ -156,7 +156,7 @@ module Edoors
if pending_link
p2 = @spin.require_p p.class
p2.clone_data p
- p2.apply_link! link
+ p2.apply_link! pending_link
send_p p2
end
pending_link = link
diff --git a/spec/room_spec.rb b/spec/room_spec.rb
index 3757951..c0b361e 100644
--- a/spec/room_spec.rb
+++ b/spec/room_spec.rb
@@ -220,15 +220,16 @@ describe Edoors::Room do
attr_reader :count
def receive_p p
@count||=0
+ ['0','1','2'][@count].should == p.next_dst
@count += 1
end
end
door1 = Out.new 'door1', room0
- room0.add_link Edoors::Link.new('door0', 'door1')
- room0.add_link Edoors::Link.new('door0', 'door1', 'keys', {'f0'=>'v0'})
- room0.add_link Edoors::Link.new('door0', 'door1', 'keys', {'f0'=>'v0','f1'=>'v1'})
- room0.add_link Edoors::Link.new('door0', 'door1', 'keys', {'f0'=>'v0','f1'=>'v2'})
- room0.add_link Edoors::Link.new('door0', 'door1', 'keys', {'f0'=>'v0','f2'=>'v1'})
+ room0.add_link Edoors::Link.new('door0', ['door1','0'])
+ room0.add_link Edoors::Link.new('door0', ['door1','1'], 'keys', {'f0'=>'v0'})
+ room0.add_link Edoors::Link.new('door0', ['door1','2'], 'keys', {'f0'=>'v0','f1'=>'v1'})
+ room0.add_link Edoors::Link.new('door0', ['door1','3'], 'keys', {'f0'=>'v0','f1'=>'v2'})
+ room0.add_link Edoors::Link.new('door0', ['door1','4'], 'keys', {'f0'=>'v0','f2'=>'v1'})
p = @spin.require_p Edoors::Particle
p['f0']='v0'
p['f1']='v1'