Skip to content

Commit a5ef772

Browse files
committed
[Rails3] Update the RUNNING_UNIT_TESTS notes a bit. I hate docs :/
1 parent c0abfc5 commit a5ef772

File tree

2 files changed

+37
-42
lines changed

2 files changed

+37
-42
lines changed

RAILS3_NOTES

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,8 @@
11

22
= SQL Server Testing Setup
33

4-
1) Clone adapter http://github.com/rails-sqlserver/2000-2005-adapter.
5-
2) The master branch is the one under development for rails 3.
6-
7-
= Rails & Arel Testing Setup
8-
9-
1) Clone rails.
10-
2) Creat a local topic branch, maybe something like sqlserver_3.0.0.beta
11-
3) Apply the following diff, till we push this upstream. http://gist.github.com/443568
12-
4) Set the RAILS_SOURCE environment variable with the path of this repo.
13-
5) It is optional, but you can set an AREL environment variable to the official
14-
git fork of arel at rails/arel. As of now there is no need to do this as our
15-
Gemfile will source this and we currently host our own compiler in this project.
16-
17-
= Testing Last Steps And Notes
18-
19-
So bundler manages the dependencies now and if you have set the correct environment
20-
variables then all dependency paths for development should be resolved. Please use
21-
the latest 1.0.0 beta of Bundler. Since we put bundler as a development dependency in
22-
the adapter, all you need to do is run "rake test" after bundling.
23-
24-
Remember you have to set an environment variable for the DSN of the adapter, see the ODBC
25-
connection information for details. Lastly, it is typically good practice to do your work
26-
on a local branch of our remote tracking branch.
4+
Create a local topic branch, maybe something like sqlserver_3.0.0.beta
5+
Apply the following diff, till we push this upstream. http://gist.github.com/443568
276

287

298

RUNNING_UNIT_TESTS

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,39 @@
1-
== Creating the test database
1+
2+
= Creating the test databases
23

34
The default names for the test databases are "activerecord_unittest" and
45
"activerecord_unittest2". If you want to use another database name then be sure
5-
to update the connection adapter setups you want to test with in
6-
test/connections/<your database>/connection.rb.
7-
8-
The connection files make certain assumptions. For instance, the ODBC connection
9-
assumes you have a DSN setup that matches the name of the default database names.
10-
11-
12-
== Requirements
13-
14-
* gem install shoulda
15-
* gem install mocha
16-
17-
The tests of this adapter depend on the existence of rails checkout. Make sure
18-
to checkout remotes/origin/2-3-stable, then make sure to export RAILS_SOURCE to
19-
the full path of that repo.
20-
21-
Define a user named 'rails' in SQL Server with all privileges granted for the
22-
test databases. Use an empty password for said user.
6+
to update the connection file that matches your connection method in
7+
test/connections/native_sqlserver_<connection_method>/connection.rb. Define a
8+
user named 'rails' in SQL Server with all privileges granted for the test
9+
databases. Use an empty password for said user.
10+
11+
The connection files make certain assumptions. For instance, the ODBC
12+
connection assumes you have a DSN setup that matches the name of the default
13+
database names. Remember too you have to set an environment variable for the
14+
DSN of the adapter, see the ODBC connection information for details.
15+
16+
17+
= Cloning The Repos
18+
19+
Clone adapter git://github.com/rails-sqlserver/2000-2005-adapter.git. The master
20+
branch is the one under development for rails 3, track the repos 2-3-stable
21+
branch for 2.x development.
22+
23+
The tests of this adapter depend on the existence of the rails source which can
24+
be cloned at git://github.com/rails/rails.git. Like the adapter, the master is
25+
for 3.x development and it has its own 2-x-stable branches which can be tracked
26+
or checked out for local testing.
27+
28+
Set the RAILS_SOURCE environment variable with the full path of the rails repo.
29+
It is optional, but you can set an AREL environment variable to the path of your
30+
clone of the official git fork of arel found at git://github.com/rails/arel.git.
31+
As of now there is no need to do this as our Gemfile will source this and we currently
32+
host our own compiler in this project.
33+
34+
Now with all that out of the way you can run "bundle install" to hook everything up.
35+
Our tests use bundler to setup the load paths correctly. If all goes well, you should
36+
be able to run "rake test" which will load all the adapter tests followed by the
37+
core ActiveRecord tests. Lastly, it is typically good practice to do your work
38+
on a local branch of our remote tracking branch.
2339

0 commit comments

Comments
 (0)