summaryrefslogtreecommitdiffstats
path: root/test/test_evendoors.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-04 09:45:18 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-04 09:45:18 +0200
commit2848c599841ae851238a361e7a6c27aa869ea100 (patch)
tree1000b97ac92b5ace9ae1e6b6bbe3a23c21424d48 /test/test_evendoors.rb
parentf52b4843d1b195cac387d83f72db9a20c8ea725d (diff)
downloadedoors-ruby-2848c599841ae851238a361e7a6c27aa869ea100.zip
edoors-ruby-2848c599841ae851238a361e7a6c27aa869ea100.tar.gz
yeeeah ... I know
Diffstat (limited to 'test/test_evendoors.rb')
-rw-r--r--test/test_evendoors.rb17
1 files changed, 15 insertions, 2 deletions
diff --git a/test/test_evendoors.rb b/test/test_evendoors.rb
index c469539..05b771b 100644
--- a/test/test_evendoors.rb
+++ b/test/test_evendoors.rb
@@ -5,6 +5,7 @@ require 'evendoors'
#
class InputDoor < EvenDoors::Door
+ #
def start!
puts " * start #{self.class.name} #{@path}" if EvenDoors::Twirl.debug
@lines = [ "#{name} says : hello", "world ( from #{path} )" ]
@@ -12,9 +13,11 @@ class InputDoor < EvenDoors::Door
p.set_dst EvenDoors::ACT_GET, path
send_p p
end
+ #
# def stop!
# puts " * stop #{self.class.name} #{@path}" if EvenDoors::Twirl.debug
# end
+ #
def receive p
puts " * #{self.class.name} receive_p : #{p.action}" if EvenDoors::Twirl.debug
if p.action==EvenDoors::ACT_GET
@@ -34,15 +37,19 @@ class InputDoor < EvenDoors::Door
release_p p
end
end
+ #
end
#
class OutputDoor < EvenDoors::Door
+ #
# def start!
# puts " * start #{self.class.name} #{@path}" if EvenDoors::Twirl.debug
# end
+ #
# def stop!
# puts " * stop #{self.class.name} #{@path}" if EvenDoors::Twirl.debug
# end
+ #
def receive p
if EvenDoors::Twirl.debug
puts " * #{self.class.name} receive_p : #{@path} : DATA #{p.get_data('line')}"
@@ -51,15 +58,21 @@ class OutputDoor < EvenDoors::Door
end
# we do nothing EvenDoors::Twirl.process will detect it and release it
end
+ #
end
#
space = EvenDoors::Space.new 'space', :debug=>false
+#
room0 = EvenDoors::Room.new 'room0', space
room1 = space.add_spot EvenDoors::Room.new 'room1'
+#
input0 = room0.add_spot InputDoor.new 'input0'
output0 = room0.add_spot OutputDoor.new 'output0'
-input1 = room1.add_spot InputDoor.new 'input1'
-output1 = room1.add_spot OutputDoor.new 'output1'
+#
+input1 = InputDoor.new 'input1'
+output1 = OutputDoor.new 'output1'
+room1.add_spot input1
+room1.add_spot output1
#
room0.add_link EvenDoors::Link.new('input0', 'output0', nil, nil, nil)
#