Skip to content

Commit

Permalink
Skip Memcache tests if no servers can be found
Browse files Browse the repository at this point in the history
  • Loading branch information
josh committed Apr 28, 2009
1 parent 5a2eae5 commit c8bf180
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/spec_rack_session_memcache.rb
Expand Up @@ -6,6 +6,8 @@
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]+;/
Expand Down Expand Up @@ -235,6 +237,8 @@
session['foo'].should.equal 'bar'
end
end
rescue RuntimeError
$stderr.puts "Skipping Rack::Session::Memcache tests. Start memcached and try again."
rescue LoadError
$stderr.puts "Skipping Rack::Session::Memcache tests (Memcache is required). `gem install memcache-client` and try again."
end

0 comments on commit c8bf180

Please sign in to comment.