Sha256: 6c1eaeb39eddfdee5723d17c60cbd57aba02af36651a3cf88824f7c82ed20f63

Contents?: true

Size: 951 Bytes

Versions: 10

Compression:

Stored size: 951 Bytes

Contents

require 'rubygems'
require 'spec'

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

require 'couch_potato'

if ENV["RUN_CODE_RUN"]
  CouchPotato::Config.database_name = 'http://langalex.couch.io/couch_potato_test'
else
  CouchPotato::Config.database_name = 'couch_potato_test'
end


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

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

Version data entries

10 entries across 10 versions & 2 rubygems

Version Path
davber_couch_potato-0.3.0 spec/spec_helper.rb
couch_potato-0.3.0 spec/spec_helper.rb
couch_potato-0.2.32 spec/spec_helper.rb
couch_potato-0.2.31 spec/spec_helper.rb
couch_potato-0.2.30 spec/spec_helper.rb
couch_potato-0.2.29 spec/spec_helper.rb
couch_potato-0.2.28 spec/spec_helper.rb
couch_potato-0.2.27 spec/spec_helper.rb
couch_potato-0.2.26 spec/spec_helper.rb
couch_potato-0.2.25 spec/spec_helper.rb