Skip to content
This repository
Browse code

travis conf

  • Loading branch information...
commit 5f916bbc1da1ec3ce3ab2fbf7ea4d8e3859bceb5 1 parent c67784a
Artem Kramarenko authored August 03, 2011
5  .travis.yml
... ...
@@ -1,6 +1,11 @@
  1
+script: spec/ci.sh
1 2
 rvm:
2 3
   - 1.8.7
3 4
   - ree
4 5
   - 1.9.2
5 6
   - jruby
6 7
   - rbx
  8
+env:
  9
+  - DB=sqlite3
  10
+  - DB=mysql
  11
+  - DB=postgresql
1  Rakefile
@@ -11,4 +11,3 @@ RSpec::Core::RakeTask.new do |t|
11 11
 end
12 12
 
13 13
 Bundler::GemHelper.install_tasks
14  
-
2  spec/ci.sh
... ...
@@ -0,0 +1,2 @@
  1
+#!/usr/bin/env sh
  2
+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  spec/database.yml.sample
@@ -3,7 +3,7 @@ sqlite3:
3 3
   database: acts_as_taggable_on.sqlite3
4 4
 
5 5
 mysql:
6  
-  adapter: mysql
  6
+  adapter: mysql2
7 7
   hostname: localhost
8 8
   username: root
9 9
   password:
11  spec/spec_helper.rb
@@ -30,14 +30,17 @@ def freq
30 30
   end
31 31
 end
32 32
 
33  
-ENV['DB'] ||= 'sqlite3'
34  
-
  33
+db_name = ENV['DB'] || 'sqlite3'
35 34
 database_yml = File.expand_path('../database.yml', __FILE__)
  35
+
36 36
 if File.exists?(database_yml)
37  
-  active_record_configuration = YAML.load_file(database_yml)[ENV['DB']]
  37
+  active_record_configuration = YAML.load_file(database_yml)
  38
+  
  39
+  ActiveRecord::Base.configurations = active_record_configuration
38 40
   
39  
-  ActiveRecord::Base.establish_connection(active_record_configuration)
  41
+  ActiveRecord::Base.establish_connection(db_name)
40 42
   ActiveRecord::Base.logger = Logger.new(File.join(File.dirname(__FILE__), "debug.log"))
  43
+  ActiveRecord::Base.default_timezone = :utc
41 44
   
42 45
   ActiveRecord::Base.silence do
43 46
     ActiveRecord::Migration.verbose = false

0 notes on commit 5f916bb

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