44SQLSERVER_MIGRATIONS_ROOT = File . expand_path ( File . join ( SQLSERVER_TEST_ROOT , 'migrations' ) )
55SQLSERVER_SCHEMA_ROOT = File . expand_path ( File . join ( SQLSERVER_TEST_ROOT , 'schema' ) )
66ACTIVERECORD_TEST_ROOT = File . expand_path ( File . join ( Gem . loaded_specs [ 'activerecord' ] . full_gem_path , 'test' ) )
7- AREL_TEST_ROOT = File . expand_path ( File . join ( Gem . loaded_specs [ 'arel' ] . full_gem_path , 'test' ) )
87
98ENV [ 'ARCONFIG' ] = File . expand_path ( File . join ( SQLSERVER_TEST_ROOT , 'config.yml' ) )
109
11- $:. unshift ACTIVERECORD_TEST_ROOT
12- $LOAD_PATH. unshift AREL_TEST_ROOT
10+ $LOAD_PATH. unshift ACTIVERECORD_TEST_ROOT
1311
1412require 'rubygems'
1513require 'bundler'
1614Bundler . setup
1715require 'simplecov'
18- SimpleCov . start do
19- add_filter "/test/"
20- end
21- require 'turn'
22- Turn . config do |c |
23- c . format = :dot
24- #c.trace = 10
25- # c.natural = true
26- c . verbose = true
27- end
28-
2916require 'graphviz'
30-
3117require 'mocha/api'
3218require 'active_support/dependencies'
3319require 'active_record'
3723require 'minitest-spec-rails/init/mini_shoulda'
3824require 'cases/helper'
3925require 'models/topic'
26+ require 'cases/arel_helper'
27+
28+ SimpleCov . start do
29+ add_filter "/test/"
30+ end
31+
4032GC . copy_on_write_friendly = true if GC . respond_to? ( :copy_on_write_friendly? )
4133
4234ActiveRecord ::Migration . verbose = false
@@ -120,17 +112,10 @@ def with_auto_connect(boolean)
120112 end
121113end
122114
123- #useful for debugging Arel.
124- # You can call it like arel_to_png(User.where(name: "foo").arel)
125- def arel_to_png ( arel )
126- graph = GraphViz . parse_string ( arel . to_dot )
127- graph . output ( :png => "query.png" )
128- end
115+ # Core AR.
116+ schema_file = "#{ ACTIVERECORD_TEST_ROOT } /schema/schema.rb"
117+ eval ( File . read ( schema_file ) )
129118
130- # Core AR.
131- schema_file = "#{ ACTIVERECORD_TEST_ROOT } /schema/schema.rb"
132- eval ( File . read ( schema_file ) )
133-
134- # SQL Server.
135- sqlserver_specific_schema_file = "#{ SQLSERVER_SCHEMA_ROOT } /sqlserver_specific_schema.rb"
136- eval ( File . read ( sqlserver_specific_schema_file ) )
119+ # SQL Server.
120+ sqlserver_specific_schema_file = "#{ SQLSERVER_SCHEMA_ROOT } /sqlserver_specific_schema.rb"
121+ eval ( File . read ( sqlserver_specific_schema_file ) )
0 commit comments