couchrest_model/spec/spec_helper.rb

20 lines
506 B
Ruby
Raw Normal View History

2008-12-19 02:09:20 -08:00
require "rubygems"
require "spec" # Satisfies Autotest and anyone else not using the Rake tasks
2008-08-03 12:51:17 -07:00
require File.dirname(__FILE__) + '/../lib/couchrest'
2009-01-12 19:50:00 -08:00
unless defined?(FIXTURE_PATH)
FIXTURE_PATH = File.dirname(__FILE__) + '/fixtures'
SCRATCH_PATH = File.dirname(__FILE__) + '/tmp'
2008-10-14 15:08:17 -07:00
2009-01-12 19:50:00 -08:00
COUCHHOST = "http://127.0.0.1:5984"
TESTDB = 'couchrest-test'
end
2008-11-08 16:28:58 -08:00
def reset_test_db!
cr = CouchRest.new(COUCHHOST)
db = cr.database(TESTDB)
db.delete! rescue nil
db = cr.create_db(TESTDB) rescue nin
db
end