Sha256: d42395f8c3e2769ff79f3cfdb834ec057c422a683a809303722aba92e3cef0cc

Contents?: true

Size: 966 Bytes

Versions: 4

Compression:

Stored size: 966 Bytes

Contents

require 'rubygems'
require 'spec'
require 'time'

$:.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

4 entries across 4 versions & 2 rubygems

Version Path
davber_couch_potato-0.4.0 spec/spec_helper.rb
couch_potato-0.4.0 spec/spec_helper.rb
couch_potato-0.3.2 spec/spec_helper.rb
couch_potato-0.3.1 spec/spec_helper.rb