2008-12-19 11:09:20 +01:00
|
|
|
require "rubygems"
|
|
|
|
require "spec" # Satisfies Autotest and anyone else not using the Rake tasks
|
|
|
|
|
2009-01-30 03:25:45 +01:00
|
|
|
require File.join(File.dirname(__FILE__), '/../lib/couchrest')
|
2008-07-05 01:56:37 +02:00
|
|
|
|
2009-01-13 04:50:00 +01:00
|
|
|
unless defined?(FIXTURE_PATH)
|
2009-01-30 03:25:45 +01:00
|
|
|
FIXTURE_PATH = File.join(File.dirname(__FILE__), '/fixtures')
|
|
|
|
SCRATCH_PATH = File.join(File.dirname(__FILE__), '/tmp')
|
2008-10-15 00:08:17 +02:00
|
|
|
|
2009-01-13 04:50:00 +01:00
|
|
|
COUCHHOST = "http://127.0.0.1:5984"
|
2009-01-30 03:25:45 +01:00
|
|
|
TESTDB = 'couchrest-test'
|
|
|
|
TEST_SERVER = CouchRest.new
|
|
|
|
TEST_SERVER.default_database = TESTDB
|
2009-01-13 04:50:00 +01:00
|
|
|
end
|
2008-11-09 01:28:58 +01:00
|
|
|
|
|
|
|
def reset_test_db!
|
2009-01-30 03:25:45 +01:00
|
|
|
cr = TEST_SERVER
|
2008-11-09 01:28:58 +01:00
|
|
|
db = cr.database(TESTDB)
|
2009-01-30 03:25:45 +01:00
|
|
|
db.recreate! rescue nil
|
2008-11-09 01:28:58 +01:00
|
|
|
db
|
|
|
|
end
|