Sha256: 804e013b09f174f39d8af8703835324e6a75c9e2cd1d3afc08ca12df5cf74370

Contents?: true

Size: 911 Bytes

Versions: 9

Compression:

Stored size: 911 Bytes

Contents

require 'rubygems'
require 'rspec'
require 'time'
require 'active_support'
require 'timecop'

$:.unshift(File.dirname(__FILE__) + '/../lib')

require 'couch_potato'

CouchPotato::Config.database_name = ENV['DATABASE'] || 'couch_potato_test'
CouchPotato::Config.validation_framework = ENV['VALIDATION_FRAMEWORK'].to_sym unless ENV['VALIDATION_FRAMEWORK'].blank?

# silence deprecation warnings from ActiveModel as the Spec uses Errors#on
begin
  ActiveSupport::Deprecation.silenced = true
rescue
  # ignore errors, ActiveSupport is probably not installed
end

class Child
  include CouchPotato::Persistence

  property :text
end

class Comment
  include CouchPotato::Persistence

  validates_presence_of :title

  property :title
end

def recreate_db
  CouchPotato.couchrest_database.recreate!
end
recreate_db

RSpec::Matchers.define :string_matching do |regex|
  match do |string|
    string =~ regex
  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
couch_potato-0.6.0 spec/spec_helper.rb
couch_potato-0.5.7 spec/spec_helper.rb
couch_potato-rails2-0.5.10 spec/spec_helper.rb
couch_potato-rails2-0.5.9 spec/spec_helper.rb
couch_potato-rails2-0.5.8 spec/spec_helper.rb
couch_potato-rails2-0.5.7 spec/spec_helper.rb
couch_potato-rails2-0.5.6 spec/spec_helper.rb
couch_potato-0.5.6 spec/spec_helper.rb
couch_potato-0.5.5 spec/spec_helper.rb