summaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
authorJérémy <jeremy@asynk.ch>2012-05-10 21:25:43 +0200
committerJérémy <jeremy@asynk.ch>2012-05-10 21:25:43 +0200
commit62a07e34c3af77fbe6735dc315bc0d28a3f891bc (patch)
tree2c8198f282c21f7d42cfa07543ede6652d9b721b /spec
parent9b704b544d33ab3db45a3519bd25aa27c25d89ad (diff)
downloadedoors-ruby-62a07e34c3af77fbe6735dc315bc0d28a3f891bc.zip
edoors-ruby-62a07e34c3af77fbe6735dc315bc0d28a3f891bc.tar.gz
specs: follow new Spin#clear! policy
Diffstat (limited to 'spec')
-rw-r--r--spec/board_spec.rb4
-rw-r--r--spec/door_spec.rb4
-rw-r--r--spec/link_spec.rb4
-rw-r--r--spec/particle_spec.rb5
-rw-r--r--spec/room_spec.rb7
-rw-r--r--spec/spin_spec.rb20
-rw-r--r--spec/spot_spec.rb4
7 files changed, 31 insertions, 17 deletions
diff --git a/spec/board_spec.rb b/spec/board_spec.rb
index e4cf9b2..45d4112 100644
--- a/spec/board_spec.rb
+++ b/spec/board_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Board do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "require_p release_p" do
board = EvenDoors::Board.new 'hell'
p0 = board.require_p EvenDoors::Particle
diff --git a/spec/door_spec.rb b/spec/door_spec.rb
index 93cd975..2899b95 100644
--- a/spec/door_spec.rb
+++ b/spec/door_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Door do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "require_p release_p" do
door = EvenDoors::Door.new 'hell'
p0 = door.require_p EvenDoors::Particle
diff --git a/spec/link_spec.rb b/spec/link_spec.rb
index fe53cf0..29ecd92 100644
--- a/spec/link_spec.rb
+++ b/spec/link_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Link do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "from particle data" do
p = EvenDoors::Spin.require_p EvenDoors::Particle
p.set_data EvenDoors::LNK_SRC, 'input1'
diff --git a/spec/particle_spec.rb b/spec/particle_spec.rb
index 41ef9a2..8c48cd1 100644
--- a/spec/particle_spec.rb
+++ b/spec/particle_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Particle do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "payload manipulation" do
p = EvenDoors::Particle.new
#
@@ -184,7 +188,6 @@ describe EvenDoors::Particle do
end
#
it "json from to should work" do
- EvenDoors::Spin.spin = nil
s0 = EvenDoors::Spin.new 'top'
s1 = EvenDoors::Room.new 'room0', s0
s2 = EvenDoors::Room.new 'room1', s1
diff --git a/spec/room_spec.rb b/spec/room_spec.rb
index badea97..fede784 100644
--- a/spec/room_spec.rb
+++ b/spec/room_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Room do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "add_spot and add_link correctly" do
EvenDoors::Spin.debug_routing = false
r0 = EvenDoors::Room.new 'room0', nil
@@ -31,7 +35,6 @@ describe EvenDoors::Room do
end
#
it "parent, spin and search_down should be ok" do
- EvenDoors::Spin.spin = nil
s = EvenDoors::Spin.new 'dom0'
r0 = EvenDoors::Room.new 'r0', s
r1 = EvenDoors::Room.new 'r1', r0
@@ -243,8 +246,6 @@ describe EvenDoors::Room do
end
#
it "SYS_ACT_ADD_LINK" do
- EvenDoors::Spin.clear!
- EvenDoors::Spin.spin = nil
spin = EvenDoors::Spin.new 'dom0' # needed to be able to route to door
room0 = EvenDoors::Room.new 'room0', spin
door0 = EvenDoors::Door.new 'door0', room0
diff --git a/spec/spin_spec.rb b/spec/spin_spec.rb
index 97ba7b2..1e640b2 100644
--- a/spec/spin_spec.rb
+++ b/spec/spin_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Spin do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
class MyP < EvenDoors::Particle; end
#
it "Particles pool" do
@@ -56,25 +60,15 @@ describe EvenDoors::Spin do
f.sp.should be p1
end
#
- it "options" do
+ it "option debug" do
EvenDoors::Spin.debug_routing.should be false
- spin = EvenDoors::Spin.new 'dom0', :debug_routing=>true
- EvenDoors::Spin.debug_routing.should be true
- spin.spin!
- EvenDoors::Spin.debug_routing = false
- EvenDoors::Spin.debug_routing.should be false
- #
- EvenDoors::Spin.spin = nil
EvenDoors::Spin.debug_errors.should be false
- spin = EvenDoors::Spin.new 'dom0', :debug_errors=>true
+ spin = EvenDoors::Spin.new 'dom0', :debug_routing=>true, :debug_errors=>true
+ EvenDoors::Spin.debug_routing.should be true
EvenDoors::Spin.debug_errors.should be true
- spin.spin!
- EvenDoors::Spin.debug_errors = false
- EvenDoors::Spin.debug_errors.should be false
end
#
it "only 1 Spin instance" do
- EvenDoors::Spin.spin = nil
spin = EvenDoors::Spin.new 'dom0', :debug_routing=>true
lambda { EvenDoors::Spin.new('dom1') }.should raise_error(EvenDoors::Exception)
end
diff --git a/spec/spot_spec.rb b/spec/spot_spec.rb
index 3698ae9..b33acb2 100644
--- a/spec/spot_spec.rb
+++ b/spec/spot_spec.rb
@@ -6,6 +6,10 @@ require 'spec_helper'
#
describe EvenDoors::Spot do
#
+ before(:each) do
+ EvenDoors::Spin.clear!
+ end
+ #
it "path construction" do
s0 = EvenDoors::Spot.new 'top', nil
s1 = EvenDoors::Spot.new 'room0', s0