summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--spec/particle_spec.rb6
-rw-r--r--spec/room_spec.rb16
2 files changed, 11 insertions, 11 deletions
diff --git a/spec/particle_spec.rb b/spec/particle_spec.rb
index 2a6d073..4952000 100644
--- a/spec/particle_spec.rb
+++ b/spec/particle_spec.rb
@@ -142,7 +142,7 @@ describe Iotas::Particle do
it "routing: error!" do
p = Iotas::Particle.new
d = Iotas::Door.new 'door', nil
- p.src = d
+ p.init! d
p.add_dsts 'door?action,?action'
p.next_dst.should eql 'door?action'
p.error! 'err_msg'
@@ -193,7 +193,7 @@ describe Iotas::Particle do
p0['k0'] = 'v0'
p0['k1'] = 'v1'
p0['k2'] = 'v2'
- p0.src = s3
+ p0.init! s3
p0.set_link_fields 'k0,k2'
p0.add_dsts 'room0/room1/room2/doorX?myaction,door?action,?action'
p0.split_dst!
@@ -201,7 +201,7 @@ describe Iotas::Particle do
p1['k3'] = 'v6'
p1['k4'] = 'v7'
p1['k5'] = 'v8'
- p1.src = s3
+ p1.init! s3
p1.dst_routed! s4
p1.set_link_fields 'k5,k4,k3'
p1.add_dsts 'room0/room1/door?action,output?action'
diff --git a/spec/room_spec.rb b/spec/room_spec.rb
index c240ac6..3f62681 100644
--- a/spec/room_spec.rb
+++ b/spec/room_spec.rb
@@ -62,7 +62,7 @@ describe Iotas::Room do
room0 = Iotas::Room.new 'room0', @spin
door0 = Iotas::Door.new 'door0', room0
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new( 'fake', @spin)
p.set_dst! 'get', 'door0'
room0.send_p p
p.action.should eql 'get'
@@ -74,7 +74,7 @@ describe Iotas::Room do
room1 = Iotas::Room.new 'room1', room0
door0 = Iotas::Door.new 'door0', room1
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new('fake', @spin)
p.set_dst! 'get', 'dom0/room0/room1/door0'
room0.send_p p
p.action.should eql 'get'
@@ -94,7 +94,7 @@ describe Iotas::Room do
it "route error: no destination no links" do
room = Iotas::Room.new 'room', @spin
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new('fake', @spin)
room.send_p p
p.action.should eql Iotas::ACT_ERROR
p[Iotas::FIELD_ERROR_MSG].should eql Iotas::ERROR_ROUTE_NDNL
@@ -104,7 +104,7 @@ describe Iotas::Room do
it "route error: no rooom, wrong door -> right room wrong door" do
room0 = Iotas::Room.new 'room0', @spin
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new('fake', @spin)
p.set_dst! 'get', 'nodoor'
room0.send_p p
p.action.should eql Iotas::ACT_ERROR
@@ -115,7 +115,7 @@ describe Iotas::Room do
it "route error: right rooom, wrong door -> right room wrong door" do
room0 = Iotas::Room.new 'room0', @spin
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new('fake', @spin)
p.set_dst! 'get', 'dom0/room0/nodoor'
room0.send_p p
p.action.should eql Iotas::ACT_ERROR
@@ -127,7 +127,7 @@ describe Iotas::Room do
room0 = Iotas::Room.new 'room0', @spin
room1 = Iotas::Room.new 'room1', room0
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', room0
+ p.init! Fake.new('fake', room0)
p.set_dst! 'get', 'dom0/room0/nodoor'
room1.send_p p
p.action.should eql Iotas::ACT_ERROR
@@ -139,7 +139,7 @@ describe Iotas::Room do
room0 = Iotas::Room.new 'room0', @spin
room1 = Iotas::Room.new 'room1', room0
p = @spin.require_p Iotas::Particle
- p.src = Fake.new 'fake', @spin
+ p.init! Fake.new('fake', @spin)
p.set_dst! 'get', 'dom0/noroom/fake'
room1.send_p p
p.action.should eql Iotas::ACT_ERROR
@@ -151,7 +151,7 @@ describe Iotas::Room do
room0 = Iotas::Room.new 'room0', @spin
door0 = Iotas::Door.new 'door0', room0
p = @spin.require_p Iotas::Particle
- p.src = door0
+ p.init! door0
p.set_dst! 'get'
room0.send_p p
p.action.should eql 'get'