Skip to content

Commit

Permalink
try to fix travis build
Browse files Browse the repository at this point in the history
  • Loading branch information
mislav committed Jul 28, 2011
1 parent e434738 commit db32fcf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@ rvm:
gemfile:
- Gemfile
- Gemfile.rails3.0
before_script:
- "mysql -e 'create database will_paginate;'"
- "psql -c 'create database will_paginate;' -U postgres"
env:
- DB=sqlite3
- DB=mysql
Expand Down
14 changes: 13 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ begin
rescue LoadError
# no spec tasks
else
task :default => :spec
task :default => [:create_database, :spec]

desc 'Run ALL OF the specs'
RSpec::Core::RakeTask.new(:spec) do |t|
Expand All @@ -19,6 +19,18 @@ else
end
end

desc 'Create necessary databases'
task :create_database do |variable|
case ENV['DB']
when 'mysql', 'mysql2'
`mysql -e 'create database will_paginate;'`
abort "failed to create mysql database" unless $?.success?
when 'postgres'
`psql -c 'create database will_paginate;' -U postgres`
abort "failed to create postgres database" unless $?.success?
end
end

desc 'Run specs against both Rails 3.1 and Rails 3.0'
task :rails3 do |variable|
system 'bundle exec rake spec && BUNDLE_GEMFILE=Gemfile.rails3.0 bundle exec rake spec:rails'
Expand Down

0 comments on commit db32fcf

Please sign in to comment.