summary refs log tree commit
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2009-04-28 10:22:02 -0500
committerJoshua Peek <josh@joshpeek.com>2009-04-28 10:22:02 -0500
commit491dbff6b53cc59a02a71024330dbbbca76dddbe (patch)
tree1830fccb9b58f57dd184137fd7af5c6b2a2346cc
parentc8bf180f4316c04627c090c78abfc4b7c24a34f4 (diff)
downloadrack-491dbff6b53cc59a02a71024330dbbbca76dddbe.tar.gz
Fix constant already defined warning in tests
-rw-r--r--test/spec_rack_directory.rb2
-rw-r--r--test/spec_rack_file.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/test/spec_rack_directory.rb b/test/spec_rack_directory.rb
index 540c728d..d255c91d 100644
--- a/test/spec_rack_directory.rb
+++ b/test/spec_rack_directory.rb
@@ -6,7 +6,7 @@ require 'rack/lint'
 require 'rack/mock'
 
 context "Rack::Directory" do
-  DOCROOT = File.expand_path(File.dirname(__FILE__))
+  DOCROOT = File.expand_path(File.dirname(__FILE__)) unless defined? DOCROOT
   FILE_CATCH = proc{|env| [200, {'Content-Type'=>'text/plain', "Content-Length" => "7"}, ['passed!']] }
   app = Rack::Directory.new DOCROOT, FILE_CATCH
 
diff --git a/test/spec_rack_file.rb b/test/spec_rack_file.rb
index 1e6771ab..0a2f8ee8 100644
--- a/test/spec_rack_file.rb
+++ b/test/spec_rack_file.rb
@@ -6,7 +6,7 @@ require 'rack/lint'
 require 'rack/mock'
 
 context "Rack::File" do
-  DOCROOT = File.expand_path(File.dirname(__FILE__))
+  DOCROOT = File.expand_path(File.dirname(__FILE__)) unless defined? DOCROOT
 
   specify "serves files" do
     res = Rack::MockRequest.new(Rack::Lint.new(Rack::File.new(DOCROOT))).