-
Notifications
You must be signed in to change notification settings - Fork 563
/
Copy pathpaths_sqlserver.rb
50 lines (37 loc) · 1.02 KB
/
paths_sqlserver.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
module ARTest
module SQLServer
extend self
def root_sqlserver
File.expand_path File.join(File.dirname(__FILE__), '..', '..')
end
def test_root_sqlserver
File.join root_sqlserver, 'test'
end
def root_activerecord
File.join Gem.loaded_specs['rails'].full_gem_path, 'activerecord'
end
def root_activerecord_lib
File.join root_activerecord, 'lib'
end
def root_activerecord_test
File.join root_activerecord, 'test'
end
def test_load_paths
['lib', 'test', root_activerecord_lib, root_activerecord_test]
end
def add_to_load_paths!
test_load_paths.each { |p| $LOAD_PATH.unshift(p) unless $LOAD_PATH.include?(p) }
end
def migrations_root
File.join test_root_sqlserver, 'migrations'
end
def arconfig_file
File.join test_root_sqlserver, 'config.yml'
end
def arconfig_file_env!
ENV['ARCONFIG'] = arconfig_file
end
end
end
ARTest::SQLServer.add_to_load_paths!
ARTest::SQLServer.arconfig_file_env!