summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-11 11:36:33 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-12 09:38:01 +0200
commit033f72bcdd135ca68a565eeaf86f3326ac605f5d (patch)
tree4db13c3ff7dcaf73518da5efc8a7ebfd4de35b4c /spec
parent85eb92f1c6a7309d85a19183e3401d5994483fcd (diff)
downloadedoors-ruby-033f72bcdd135ca68a565eeaf86f3326ac605f5d.zip
edoors-ruby-033f72bcdd135ca68a565eeaf86f3326ac605f5d.tar.gz
specs: Door adapt to non static wy
Diffstat (limited to 'spec')
-rw-r--r--spec/door_spec.rb20
1 files changed, 12 insertions, 8 deletions
diff --git a/spec/door_spec.rb b/spec/door_spec.rb
index 5b0fb6f..72e28a9 100644
--- a/spec/door_spec.rb
+++ b/spec/door_spec.rb
@@ -6,12 +6,16 @@ require 'spec_helper'
#
describe EvenDoors::Door do
#
+ before (:all) do
+ @spin = EvenDoors::Spin.new 'dom0'
+ end
+ #
before(:each) do
- EvenDoors::Spin.clear!
+ @spin.clear!
end
#
it "require_p release_p" do
- door = EvenDoors::Door.new 'hell'
+ door = EvenDoors::Door.new 'hell', @spin
p0 = door.require_p EvenDoors::Particle
p0.src.should be door
p1 = door.require_p EvenDoors::Particle
@@ -38,9 +42,9 @@ describe EvenDoors::Door do
end
end
end
- f = Fake.new
+ f = Fake.new 'fake', @spin
d0 = Door0.new 'door0', f
- p0 = EvenDoors::Spin.require_p EvenDoors::Particle
+ p0 = d0.require_p EvenDoors::Particle
#
p0.set_dst! 'SEND'
p0.split_dst!
@@ -55,22 +59,22 @@ describe EvenDoors::Door do
p0.set_dst! 'RELEASE'
p0.split_dst!
d0.process_p p0
- p1 = EvenDoors::Spin.require_p EvenDoors::Particle
+ p1 = d0.require_p EvenDoors::Particle
p1.should be p0
#
p0.set_dst! 'LOST'
p0.split_dst!
d0.process_p p0
- p1 = EvenDoors::Spin.require_p EvenDoors::Particle
+ p1 = d0.require_p EvenDoors::Particle
p1.should be p0
#
d0.process_sys_p p0
- p1 = EvenDoors::Spin.require_p EvenDoors::Particle
+ p1 = @spin.require_p EvenDoors::Particle
p1.should be p0
end
#
it "door->json->door" do
- door = EvenDoors::Door.new 'hell'
+ door = EvenDoors::Door.new 'hell', @spin
hell = EvenDoors::Door.json_create( JSON.load( JSON.generate(door) ) )
door.name.should eql hell.name
JSON.generate(door).should eql JSON.generate(hell)