Sha256: e9065f70a070cdfd23bb46f46750294b7f8d1d92a56792b6b6714fe87049061f

Contents?: true

Size: 985 Bytes

Versions: 22

Compression:

Stored size: 985 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
  DB = TEST_SERVER.database(TESTDB)
end

class Basic < CouchRest::ExtendedDocument
  use_database TEST_SERVER.default_database
end

def reset_test_db!
  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

22 entries across 22 versions & 6 rubygems

Version Path
mattetti-couchrest-0.31 spec/spec_helper.rb
mattetti-couchrest-0.32 spec/spec_helper.rb
mattetti-couchrest-0.33 spec/spec_helper.rb
mattetti-couchrest-0.34 spec/spec_helper.rb
norr-couchrest-0.33.01 spec/spec_helper.rb
norr-couchrest-0.33.02 spec/spec_helper.rb
norr-couchrest-0.33.06 spec/spec_helper.rb
norr-couchrest-0.33.07 spec/spec_helper.rb
peterpunk-couchrest-0.33 spec/spec_helper.rb
peterpunk-couchrest-0.34.1 spec/spec_helper.rb
sporkd-couchrest-0.30 spec/spec_helper.rb
sporkd-couchrest-0.31 spec/spec_helper.rb
sporkd-couchrest-0.33 spec/spec_helper.rb
sporkd-couchrest-0.34 spec/spec_helper.rb
will-couchrest-0.32.1 spec/spec_helper.rb
will-couchrest-0.33.1 spec/spec_helper.rb
will-couchrest-0.33 spec/spec_helper.rb
couchrest-0.35 spec/spec_helper.rb
couchrest-0.34 spec/spec_helper.rb
couchrest-0.31 spec/spec_helper.rb