Sha256: 75f731ab65bd15d3b54f8fc2ee4d01fbbc9f0e34664a745ebeae25a8278c7494

Contents?: true

Size: 1011 Bytes

Versions: 5

Compression:

Stored size: 1011 Bytes

Contents

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

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

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
couch_potato-0.5.4 spec/spec_helper.rb
couch_potato-0.5.3 spec/spec_helper.rb
couch_potato-0.5.2 spec/spec_helper.rb
couch_potato-0.5.1 spec/spec_helper.rb
couch_potato-0.5.0 spec/spec_helper.rb