summaryrefslogtreecommitdiffstats
path: root/spec/spin_spec.rb
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2012-05-10 17:34:39 +0200
committerJérémy Zurcher <jeremy@asynk.ch>2012-05-10 17:34:39 +0200
commitbed8e682e80a810c66f309faf7865872aadc85cc (patch)
tree57509b1a08d9438c12b88c36aef9a90abca72311 /spec/spin_spec.rb
parentd916c197fd06eb5f818e2bd75d5d1312c4758975 (diff)
downloadedoors-ruby-bed8e682e80a810c66f309faf7865872aadc85cc.zip
edoors-ruby-bed8e682e80a810c66f309faf7865872aadc85cc.tar.gz
Spin register itself in its class, aka singleton
Diffstat (limited to 'spec/spin_spec.rb')
-rw-r--r--spec/spin_spec.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/spec/spin_spec.rb b/spec/spin_spec.rb
index 6fd8ccd..97ba7b2 100644
--- a/spec/spin_spec.rb
+++ b/spec/spin_spec.rb
@@ -64,6 +64,7 @@ describe EvenDoors::Spin do
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
EvenDoors::Spin.debug_errors.should be true
@@ -72,6 +73,12 @@ describe EvenDoors::Spin do
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
+ #
end
#
#EOF