summary refs log tree commit
diff options
context:
space:
mode:
authorScytrin dai Kinthra <scytrin@gmail.com>2009-11-22 20:12:04 -0800
committerScytrin dai Kinthra <scytrin@gmail.com>2009-12-02 20:01:07 -0800
commit9cd37ca45503c1d1e6432e95d5444328ab4d6015 (patch)
tree45138e527d0604b1a1ef1f209880c867b2743607
parent50fc8eb0f1c35b9d0b8b4b83b603ae15c2fe0c18 (diff)
downloadrack-9cd37ca45503c1d1e6432e95d5444328ab4d6015.tar.gz
Updating Session::Memcache test
Pointless instantiation removed
Moved bad connection check above good connection check
A blank string for the server specification uses defaults, fixed
-rw-r--r--test/spec_rack_session_memcache.rb14
1 files changed, 6 insertions, 8 deletions
diff --git a/test/spec_rack_session_memcache.rb b/test/spec_rack_session_memcache.rb
index f21ac3de..4b72a2f9 100644
--- a/test/spec_rack_session_memcache.rb
+++ b/test/spec_rack_session_memcache.rb
@@ -6,8 +6,6 @@ begin
   require 'rack/response'
   require 'thread'
 
-  pool = Rack::Session::Memcache.new(lambda {})
-
   context "Rack::Session::Memcache" do
     session_key = Rack::Session::Memcache::DEFAULT_OPTIONS[:key]
     session_match = /#{session_key}=[0-9a-fA-F]+;/
@@ -29,22 +27,22 @@ begin
       incrementor.call(env)
     end
 
-    specify "MemCache can connect to existing server" do
-      test_pool = MemCache.new :namespace => 'test:rack:session'
-    end
-
     specify "faults on no connection" do
       if RUBY_VERSION < "1.9"
         lambda do
-          Rack::Session::Memcache.new(incrementor, :memcache_server => '')
+          Rack::Session::Memcache.new incrementor, :memcache_server => 'nosuchserver'
         end.should.raise
       else
         lambda do
-          Rack::Session::Memcache.new(incrementor, :memcache_server => '')
+          Rack::Session::Memcache.new incrementor, :memcache_server => 'nosuchserver'
         end.should.raise ArgumentError
       end
     end
 
+    specify "connect to existing server" do
+      test_pool = MemCache.new incrementor, :namespace => 'test:rack:session'
+    end
+
     specify "creates a new cookie" do
       pool = Rack::Session::Memcache.new(incrementor)
       res = Rack::MockRequest.new(pool).get("/")