Skip to content
Browse files

travis conf

  • Loading branch information...
1 parent c67784a commit 5f916bbc1da1ec3ce3ab2fbf7ea4d8e3859bceb5 @artemk artemk committed
Showing with 15 additions and 6 deletions.
  1. +5 −0 .travis.yml
  2. +0 −1 Rakefile
  3. +2 −0 spec/ci.sh
  4. +1 −1 spec/database.yml.sample
  5. +7 −4 spec/spec_helper.rb
View
5 .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
View
1 Rakefile
@@ -11,4 +11,3 @@ RSpec::Core::RakeTask.new do |t|
end
Bundler::GemHelper.install_tasks
-
View
2 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
View
2 spec/database.yml.sample
@@ -3,7 +3,7 @@ sqlite3:
database: acts_as_taggable_on.sqlite3
mysql:
- adapter: mysql
+ adapter: mysql2
hostname: localhost
username: root
password:
View
11 spec/spec_helper.rb
@@ -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

0 comments on commit 5f916bb

Please sign in to comment.
Something went wrong with that request. Please try again.