Updatin to not depend on Rails 3, only ActiveRecord, both in gem file and in tests
This commit is contained in:
parent
142a61aaa9
commit
6c9cbc096c
2
Gemfile
2
Gemfile
|
@ -1,6 +1,6 @@
|
||||||
source :gemcutter
|
source :gemcutter
|
||||||
|
|
||||||
gem "rails", "~> 3.0.0rc"
|
gem "activerecord", "~> 3.0.0rc"
|
||||||
|
|
||||||
group :development do
|
group :development do
|
||||||
gem "jeweler", ">= 1.4.0"
|
gem "jeweler", ">= 1.4.0"
|
||||||
|
|
|
@ -12,8 +12,7 @@ require "bundler"
|
||||||
Bundler.setup
|
Bundler.setup
|
||||||
|
|
||||||
require "logger"
|
require "logger"
|
||||||
require "rails"
|
require 'test/unit'
|
||||||
require "rails/test_help"
|
|
||||||
require "active_record"
|
require "active_record"
|
||||||
require "active_record/fixtures"
|
require "active_record/fixtures"
|
||||||
require "active_support/test_case"
|
require "active_support/test_case"
|
||||||
|
@ -21,7 +20,6 @@ require "active_support/test_case"
|
||||||
require "delorean"
|
require "delorean"
|
||||||
require "ruby-debug"
|
require "ruby-debug"
|
||||||
|
|
||||||
class MyApplication < Rails::Application ; end
|
|
||||||
adapter = ENV["ARE_DB"] || "sqlite3"
|
adapter = ENV["ARE_DB"] || "sqlite3"
|
||||||
|
|
||||||
FileUtils.mkdir_p 'log'
|
FileUtils.mkdir_p 'log'
|
||||||
|
@ -29,11 +27,9 @@ ActiveRecord::Base.logger = Logger.new("log/test.log")
|
||||||
ActiveRecord::Base.logger.level = Logger::DEBUG
|
ActiveRecord::Base.logger.level = Logger::DEBUG
|
||||||
ActiveRecord::Base.configurations["test"] = YAML.load(test_dir.join("database.yml").open)[adapter]
|
ActiveRecord::Base.configurations["test"] = YAML.load(test_dir.join("database.yml").open)[adapter]
|
||||||
|
|
||||||
|
|
||||||
require "activerecord-import"
|
require "activerecord-import"
|
||||||
ActiveRecord::Base.establish_connection "test"
|
ActiveRecord::Base.establish_connection "test"
|
||||||
|
|
||||||
|
|
||||||
ActiveSupport::Notifications.subscribe(/active_record.sql/) do |event, _, _, _, hsh|
|
ActiveSupport::Notifications.subscribe(/active_record.sql/) do |event, _, _, _, hsh|
|
||||||
ActiveRecord::Base.logger.info hsh[:sql]
|
ActiveRecord::Base.logger.info hsh[:sql]
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue