forked from mbleigh/seed-fu
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a method for running the specs on different database adapters
- Loading branch information
1 parent
70dacc6
commit 4151ec2
Showing
6 changed files
with
44 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
To run the specs: | ||
|
||
gem install bundler # If not already installed | ||
bundle install # Install the dependencies | ||
rspec spec/ # Run the specs | ||
|
||
By default an sqlite3 database is used. | ||
|
||
To test others: | ||
|
||
DB=mysql rspec spec/ | ||
DB=postgresql rspec spec/ | ||
|
||
In each of these cases, you'll need to create a database named "spec_fu_test". | ||
|
||
The connection paramaters for each of these are specified in spec/connections/, which you can edit if necessary (for example to change the username/password). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveRecord::Base.establish_connection( | ||
:adapter => "mysql2", | ||
:database => "seed_fu_test", | ||
:username => "root" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ActiveRecord::Base.establish_connection( | ||
:adapter => "postgresql", | ||
:database => "seed_fu_test", | ||
:username => "postgres" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ActiveRecord::Base.establish_connection( | ||
:adapter => "sqlite3", | ||
:database => File.dirname(__FILE__) + "/test.sqlite3" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters