Sha256: 23ae2545a95114550324bfc4ae9cc9fdcd48d3e8b92c5edd5c48a00c33297f17
Contents?: true
Size: 994 Bytes
Versions: 7
Compression:
Stored size: 994 Bytes
Contents
require "rubygems" require "spec" # Satisfies Autotest and anyone else not using the Rake tasks require File.join(File.dirname(__FILE__), '..','lib','couchrest') # check the following file to see how to use the spec'd features. unless defined?(FIXTURE_PATH) FIXTURE_PATH = File.join(File.dirname(__FILE__), '/fixtures') SCRATCH_PATH = File.join(File.dirname(__FILE__), '/tmp') COUCHHOST = "http://127.0.0.1:5984" TESTDB = 'couchrest-test' TEST_SERVER = CouchRest.new TEST_SERVER.default_database = TESTDB end class Basic < CouchRest::ExtendedDocument use_database TEST_SERVER.default_database end def reset_test_db! cr = TEST_SERVER db = cr.database(TESTDB) db.recreate! rescue nil db end Spec::Runner.configure do |config| config.before(:all) { reset_test_db! } config.after(:all) do cr = TEST_SERVER test_dbs = cr.databases.select { |db| db =~ /^#{TESTDB}/ } test_dbs.each do |db| cr.database(db).delete! rescue nil end end end
Version data entries
7 entries across 7 versions & 3 rubygems