From 5a2d4f5475b8a040e2ed2da826afe50f0b3824c7 Mon Sep 17 00:00:00 2001 From: Bryan Helmkamp Date: Tue, 15 Apr 2008 01:24:15 -0400 Subject: Fake database implementation. MySQL not required to run the tests --- spec/spec_helper.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'spec/spec_helper.rb') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 0d1613e223..af4e71d2d3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,11 +6,7 @@ dir = File.dirname(__FILE__) $LOAD_PATH.unshift "#{dir}/../lib" Dir["#{dir}/matchers/*"].each { |m| require "#{dir}/matchers/#{File.basename(m)}" } require 'active_relation' - -FileUtils.cp("#{dir}/../config/database.yml.example", "#{dir}/../config/database.yml") unless File.exist?("#{dir}/../config/database.yml") - -ActiveRecord::Base.configurations = YAML::load(IO.read("#{dir}/../config/database.yml")) -ActiveRecord::Base.establish_connection 'test' +require "#{dir}/fakes/database" class Hash def shift @@ -24,6 +20,6 @@ Spec::Runner.configure do |config| config.include(BeLikeMatcher, HashTheSameAsMatcher) config.mock_with :rr config.before do - ActiveRelation::Table.engine = ActiveRelation::Engine.new(ActiveRecord::Base) + ActiveRelation::Table.engine = ActiveRelation::Engine.new(FakeDatabase) end end \ No newline at end of file -- cgit v1.2.3