Sha256: 4e4291122aa4d1e7d71c0f97704e3b969d3ec499eccfe8bf0193d93a1da45305
Contents?: true
Size: 1.33 KB
Versions: 2
Compression:
Stored size: 1.33 KB
Contents
$LOAD_PATH.unshift(File.dirname(__FILE__)) $LOAD_PATH.unshift(File.join(File.dirname(__FILE__), "..", "lib")) require 'rails' require 'active_record' require 'rspec' require 'mocha_standalone' require 'memcached' require 'cacheable' ActiveRecord::Migration.verbose = false ActiveRecord::Base.establish_connection(:adapter => 'sqlite3', :database => ':memory:') MODELS = File.join(File.dirname(__FILE__), "models") $LOAD_PATH.unshift(MODELS) Dir[ File.join(MODELS, "*.rb") ].sort.each { |file| require File.basename(file) } module Rails class <<self def cache @cache ||= Memcached::Rails.new end end end RSpec.configure do |config| config.mock_with :mocha config.filter_run focus: true config.run_all_when_everything_filtered = true config.before :all do ::ActiveRecord::Schema.define(:version => 1) do create_table :users do |t| t.string :login end create_table :accounts do |t| t.integer :user_id end create_table :posts do |t| t.integer :user_id t.string :title end create_table :comments do |t| t.integer :commentable_id t.string :commentable_type end end end config.after :all do ::ActiveRecord::Base.connection.tables.each do |table| ::ActiveRecord::Base.connection.drop_table(table) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
simple_cacheable-1.3.0 | spec/spec_helper.rb |
simple_cacheable-1.2.1 | spec/spec_helper.rb |