1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/spec/spec_helper.rb
Bryan Helmkamp bdca9ed42f moved sql related code to its own engine area
Conflicts:

	lib/arel/engine.rb
	lib/arel/extensions/object.rb
	lib/arel/predicates.rb
	lib/arel/primitives/attribute.rb
	lib/arel/primitives/expression.rb
	lib/arel/primitives/value.rb
	lib/arel/relations/operations/join.rb
	lib/arel/relations/relation.rb
	lib/arel/relations/utilities/externalization.rb
	lib/arel/relations/utilities/nil.rb
	lib/arel/relations/writes/delete.rb
	lib/arel/relations/writes/insert.rb
	lib/arel/relations/writes/update.rb
	spec/arel/unit/relations/skip_spec.rb
	spec/arel/unit/relations/take_spec.rb
	spec/spec_helper.rb
2009-05-17 14:24:06 -04:00

35 lines
835 B
Ruby

dir = File.dirname(__FILE__)
$LOAD_PATH.unshift "#{dir}/../lib"
require 'rubygems'
require 'spec'
require 'pp'
require 'fileutils'
require 'arel'
[:matchers, :doubles].each do |helper|
Dir["#{dir}/#{helper}/*"].each { |m| require "#{dir}/#{helper}/#{File.basename(m)}" }
end
module AdapterGuards
def adapter_is(name)
yield if name.to_s == adapter_name
end
def adapter_is_not(name)
yield if name.to_s != adapter_name
end
def adapter_name
Arel::Table.engine.connection.class.name.underscore.split("/").last.gsub(/_adapter/, '')
end
end
Spec::Runner.configure do |config|
config.include BeLikeMatcher, HashTheSameAsMatcher, DisambiguateAttributesMatcher
config.include AdapterGuards
config.mock_with :rr
config.before do
Arel::Table.engine = Arel::Sql::Engine.new(ActiveRecord::Base)
end
end