aboutsummaryrefslogtreecommitdiffstats
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorBryan Helmkamp <bryan@brynary.com>2008-04-15 01:24:15 -0400
committerBryan Helmkamp <bryan@brynary.com>2008-04-15 01:24:15 -0400
commit5a2d4f5475b8a040e2ed2da826afe50f0b3824c7 (patch)
tree1f598a69220e5c7c9c97172dafd590ad03af3bfe /spec/spec_helper.rb
parent722623dab397427df7a99b7aeefe4356cadcce25 (diff)
downloadrails-5a2d4f5475b8a040e2ed2da826afe50f0b3824c7.tar.gz
rails-5a2d4f5475b8a040e2ed2da826afe50f0b3824c7.tar.bz2
rails-5a2d4f5475b8a040e2ed2da826afe50f0b3824c7.zip
Fake database implementation. MySQL not required to run the tests
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb8
1 files changed, 2 insertions, 6 deletions
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