Sha256: 795a63d18439d246d43f3135f4658783788316d8b3ebdf2fd36896afba82b9a6

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

begin
  # Try to require the preresolved locked set of gems.
  require File.expand_path("../.bundle/environment", __FILE__)
rescue LoadError
  # Fall back on doing an unlocked resolve at runtime.
  require "rubygems" unless RUBY_VERSION >= "1.9"
  require "bundler"
  Bundler.setup
end

Bundler.require
require File.expand_path('../../lib/acts-as-taggable-on', __FILE__)

if defined?(Rspec::Core::ExampleGroupSubject)
  module Rspec::Core::ExampleGroupSubject
    alias :context :describe
  end
end

class Array
  def freq
    k=Hash.new(0)
    each {|e| k[e]+=1}
    k
  end
end

# Setup a database
TEST_DATABASE_FILE = File.join(File.dirname(__FILE__), '..', 'test.sqlite3')
File.unlink(TEST_DATABASE_FILE) if File.exist?(TEST_DATABASE_FILE)
ActiveRecord::Base.establish_connection :adapter => 'sqlite3', :database => TEST_DATABASE_FILE

ActiveRecord::Base.silence do
  ActiveRecord::Migration.verbose = false
  load(File.dirname(__FILE__) + '/schema.rb')
  load(File.dirname(__FILE__) + '/models.rb')
end

def clean_database!
  $debug = false
  models = [Tag, Tagging, TaggableModel, OtherTaggableModel, InheritingTaggableModel,
            AlteredInheritingTaggableModel, TaggableUser]
  models.each do |model|
    model.destroy_all
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts-as-taggable-on-2.0.0.pre3 spec/spec_helper.rb