spec/adhearsion_spec.rb in adhearsion-2.1.3 vs spec/adhearsion_spec.rb in adhearsion-2.2.0
- old
+ new
@@ -12,11 +12,11 @@
it "should update properly the config root variable when path is nil" do
Adhearsion.root = nil
Adhearsion.config[:platform].root.should be_nil
end
end
-
+
describe "#root" do
it "should return the set root" do
Adhearsion.root = "./"
Adhearsion.root.should be == Dir.getwd
end
@@ -85,9 +85,29 @@
original = Adhearsion.active_calls
original.terminate
original.should_not be_alive
current = Adhearsion.active_calls
+ current.should be_alive
+ current.should_not be original
+ end
+ end
+
+ describe "#statistics" do
+ it "should be a statistics aggregator" do
+ Adhearsion.statistics.should be_a Adhearsion::Statistics
+ end
+
+ it "should return the same instance each time" do
+ Adhearsion.statistics.should be Adhearsion.statistics
+ end
+
+ it "should create a new aggregator if the existing one dies" do
+ original = Adhearsion.statistics
+ original.terminate
+ original.should_not be_alive
+
+ current = Adhearsion.statistics
current.should be_alive
current.should_not be original
end
end