forked from rails-sqlserver/activerecord-sqlserver-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
RUNNING_UNIT_TESTS
41 lines (29 loc) · 2.01 KB
/
RUNNING_UNIT_TESTS
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
= Creating the test databases
The default names for the test databases are "activerecord_unittest" and
"activerecord_unittest2". If you want to use another database name then be sure
to update the connection file that matches your connection method in
test/connections/native_sqlserver_<connection_method>/connection.rb. Define a
user named 'rails' in SQL Server with all privileges granted for the test
databases. Use an empty password for said user.
The connection files make certain assumptions. For instance, the ODBC
connection assumes you have a DSN setup that matches the name of the default
database names. Remember too you have to set an environment variable for the
DSN of the adapter, see the ODBC connection information for details.
= Cloning The Repos
Clone adapter git://github.com/rails-sqlserver/activerecord-sqlserver-adapter.git.
The master branch is the one under development for rails 3, track the repos 2-3-stable
branch for 2.x development.
The tests of this adapter depend on the existence of the rails source which can
be cloned at git://github.com/rails/rails.git. Like the adapter, the master is
for 3.x development and it has its own 2-x-stable branches which can be tracked
or checked out for local testing.
Set the RAILS_SOURCE environment variable with the full path of the rails repo.
It is optional, but you can set an AREL environment variable to the path of your
clone of the official git fork of arel found at git://github.com/rails/arel.git.
As of now there is no need to do this as our Gemfile will source this and we currently
host our own compiler in this project.
Now with all that out of the way you can run "bundle install" to hook everything up.
Our tests use bundler to setup the load paths correctly. If all goes well, you should
be able to run "rake test" which will load all the adapter tests followed by the
core ActiveRecord tests. Lastly, it is typically good practice to do your work
on a local branch of our remote tracking branch.