Skip to content

Commit

Permalink
travis conf
Browse files Browse the repository at this point in the history
  • Loading branch information
artemk committed Aug 3, 2011
1 parent c67784a commit 5f916bb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
@@ -1,6 +1,11 @@
script: spec/ci.sh
rvm:
- 1.8.7
- ree
- 1.9.2
- jruby
- rbx
env:
- DB=sqlite3
- DB=mysql
- DB=postgresql
1 change: 0 additions & 1 deletion Rakefile
Expand Up @@ -11,4 +11,3 @@ RSpec::Core::RakeTask.new do |t|
end

Bundler::GemHelper.install_tasks

2 changes: 2 additions & 0 deletions spec/ci.sh
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
cp spec/database.yml.example spec/database.yml && bundle install && bundle exec rake prepare_ci_env db:create db:migrate && bundle exec rake spec
2 changes: 1 addition & 1 deletion spec/database.yml.sample
Expand Up @@ -3,7 +3,7 @@ sqlite3:
database: acts_as_taggable_on.sqlite3

mysql:
adapter: mysql
adapter: mysql2
hostname: localhost
username: root
password:
Expand Down
11 changes: 7 additions & 4 deletions spec/spec_helper.rb
Expand Up @@ -30,14 +30,17 @@ def freq
end
end

ENV['DB'] ||= 'sqlite3'

db_name = ENV['DB'] || 'sqlite3'
database_yml = File.expand_path('../database.yml', __FILE__)

if File.exists?(database_yml)
active_record_configuration = YAML.load_file(database_yml)[ENV['DB']]
active_record_configuration = YAML.load_file(database_yml)

ActiveRecord::Base.configurations = active_record_configuration

ActiveRecord::Base.establish_connection(active_record_configuration)
ActiveRecord::Base.establish_connection(db_name)
ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
ActiveRecord::Base.default_timezone = :utc

ActiveRecord::Base.silence do
ActiveRecord::Migration.verbose = false
Expand Down

0 comments on commit 5f916bb

Please sign in to comment.