Permalink
Browse files

setup continuous integration testing with Travis-CI

  • Loading branch information...
1 parent 1fc2f10 commit 015d53a6d10def07f7c6f261ba414f47ce3671b8 @mislav mislav committed Jul 27, 2011
Showing with 195 additions and 68 deletions.
  1. +1 −0 .rspec
  2. +17 −0 .travis.yml
  3. +15 −10 Gemfile
  4. +15 −12 Gemfile.lock
  5. +24 −0 Gemfile.rails3.0
  6. +92 −0 Gemfile.rails3.0.lock
  7. +19 −36 Rakefile
  8. +10 −10 spec/database.yml
  9. +1 −0 spec/finders/active_record_spec.rb
  10. +1 −0 spec/finders/data_mapper_test_connector.rb
View
1 .rspec
@@ -0,0 +1 @@
+--color
View
17 .travis.yml
@@ -0,0 +1,17 @@
+rvm:
+ - 1.8.7
+ - 1.9.2
+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
+ - DB=mysql2
+ - DB=postgres
+branches:
+ only:
+ - rails3
View
25 Gemfile
@@ -1,24 +1,29 @@
-source :rubygems
+source 'http://rubygems.org'
-# path '/Users/mislav/.coral/rails-rails'
-# git 'git://github.com/rails/rails.git'
+rails_version = '~> 3.1.0.rc'
+
+gem 'activerecord', rails_version
+gem 'activeresource', rails_version
+gem 'actionpack', rails_version
gem 'rake'
-gem 'activerecord', '~> 3.1.0.rc'
-gem 'activeresource', '~> 3.1.0.rc'
-gem 'actionpack', '~> 3.1.0.rc'
-gem 'sequel', '~> 3.8'
gem 'rspec', '~> 2.6.0'
gem 'mocha', '~> 0.9.8'
+
+gem 'sequel', '~> 3.8'
gem 'sqlite3', '~> 1.3.3'
gem 'dm-core'
gem 'dm-aggregates'
gem 'dm-migrations'
gem 'dm-sqlite-adapter'
-gem 'mysql', '~> 2.8.1', :group => :mysql
-gem 'pg', '~> 0.8.0', :group => :pg
+
+group :mysql do
+ gem 'mysql', '~> 2.8.1'
+ gem 'mysql2', '>= 0.3.6'
+end
+gem 'pg', '~> 0.11', :group => :pg
group :debug do
gem 'ruby-debug', :platforms => :mri_18
gem 'ruby-debug19', :platforms => :mri_19
-end
+end unless ENV['TRAVIS']
View
27 Gemfile.lock
@@ -32,7 +32,7 @@ GEM
arel (2.1.4)
bcrypt-ruby (2.1.4)
builder (3.0.0)
- columnize (0.3.1)
+ columnize (0.3.4)
data_objects (0.10.6)
addressable (~> 2.1)
diff-lcs (1.1.2)
@@ -53,22 +53,24 @@ GEM
erubis (2.7.0)
hike (1.2.0)
i18n (0.6.0)
- linecache (0.43)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
- mocha (0.9.8)
- rake
+ mocha (0.9.12)
multi_json (1.0.3)
mysql (2.8.1)
- pg (0.8.0)
+ mysql2 (0.3.6)
+ pg (0.11.0)
rack (1.3.2)
rack-cache (1.0.2)
rack (>= 0.4)
rack-mount (0.8.1)
rack (>= 1.0.0)
- rack-test (0.6.0)
+ rack-test (0.6.1)
rack (>= 1.0)
- rake (0.8.7)
+ rake (0.9.2)
+ rbx-require-relative (0.0.5)
rspec (2.6.0)
rspec-core (~> 2.6.0)
rspec-expectations (~> 2.6.0)
@@ -77,10 +79,10 @@ GEM
rspec-expectations (2.6.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.6.0)
- ruby-debug (0.10.3)
+ ruby-debug (0.10.4)
columnize (>= 0.1)
- ruby-debug-base (~> 0.10.3.0)
- ruby-debug-base (0.10.3)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
linecache (>= 0.3)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
@@ -96,7 +98,7 @@ GEM
sprockets (2.0.0.beta.12)
hike (~> 1.2)
rack (~> 1.0)
- tilt (~> 1.1, != 1.3.0)
+ tilt (!= 1.3.0, ~> 1.1)
sqlite3 (1.3.3)
tilt (1.3.2)
tzinfo (0.3.29)
@@ -114,7 +116,8 @@ DEPENDENCIES
dm-sqlite-adapter
mocha (~> 0.9.8)
mysql (~> 2.8.1)
- pg (~> 0.8.0)
+ mysql2 (>= 0.3.6)
+ pg (~> 0.11)
rake
rspec (~> 2.6.0)
ruby-debug
View
24 Gemfile.rails3.0
@@ -0,0 +1,24 @@
+source 'http://rubygems.org'
+
+rails_version = '~> 3.0.0'
+
+gem 'activerecord', rails_version
+gem 'activeresource', rails_version
+gem 'actionpack', rails_version
+
+gem 'rake'
+gem 'rspec', '~> 2.6.0'
+gem 'mocha', '~> 0.9.8'
+
+gem 'sqlite3', '~> 1.3.3'
+
+group :mysql do
+ gem 'mysql', '~> 2.8.1'
+ gem 'mysql2', '>= 0.3.6'
+end
+gem 'pg', '~> 0.11', :group => :pg
+
+group :debug do
+ gem 'ruby-debug', :platforms => :mri_18
+ gem 'ruby-debug19', :platforms => :mri_19
+end unless ENV['TRAVIS']
View
92 Gemfile.rails3.0.lock
@@ -0,0 +1,92 @@
+GEM
+ remote: http://rubygems.org/
+ specs:
+ abstract (1.0.0)
+ actionpack (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ builder (~> 2.1.2)
+ erubis (~> 2.6.6)
+ i18n (~> 0.5.0)
+ rack (~> 1.2.1)
+ rack-mount (~> 0.6.14)
+ rack-test (~> 0.5.7)
+ tzinfo (~> 0.3.23)
+ activemodel (3.0.9)
+ activesupport (= 3.0.9)
+ builder (~> 2.1.2)
+ i18n (~> 0.5.0)
+ activerecord (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ arel (~> 2.0.10)
+ tzinfo (~> 0.3.23)
+ activeresource (3.0.9)
+ activemodel (= 3.0.9)
+ activesupport (= 3.0.9)
+ activesupport (3.0.9)
+ archive-tar-minitar (0.5.2)
+ arel (2.0.10)
+ builder (2.1.2)
+ columnize (0.3.4)
+ diff-lcs (1.1.2)
+ erubis (2.6.6)
+ abstract (>= 1.0.0)
+ i18n (0.5.0)
+ linecache (0.46)
+ rbx-require-relative (> 0.0.4)
+ linecache19 (0.5.12)
+ ruby_core_source (>= 0.1.4)
+ mocha (0.9.12)
+ mysql (2.8.1)
+ mysql2 (0.3.6)
+ pg (0.11.0)
+ rack (1.2.3)
+ rack-mount (0.6.14)
+ rack (>= 1.0.0)
+ rack-test (0.5.7)
+ rack (>= 1.0)
+ rake (0.9.2)
+ rbx-require-relative (0.0.5)
+ rspec (2.6.0)
+ rspec-core (~> 2.6.0)
+ rspec-expectations (~> 2.6.0)
+ rspec-mocks (~> 2.6.0)
+ rspec-core (2.6.4)
+ rspec-expectations (2.6.0)
+ diff-lcs (~> 1.1.2)
+ rspec-mocks (2.6.0)
+ ruby-debug (0.10.4)
+ columnize (>= 0.1)
+ ruby-debug-base (~> 0.10.4.0)
+ ruby-debug-base (0.10.4)
+ linecache (>= 0.3)
+ ruby-debug-base19 (0.11.25)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby_core_source (>= 0.1.4)
+ ruby-debug19 (0.11.6)
+ columnize (>= 0.3.1)
+ linecache19 (>= 0.5.11)
+ ruby-debug-base19 (>= 0.11.19)
+ ruby_core_source (0.1.5)
+ archive-tar-minitar (>= 0.5.2)
+ sqlite3 (1.3.4)
+ tzinfo (0.3.29)
+
+PLATFORMS
+ ruby
+
+DEPENDENCIES
+ actionpack (~> 3.0.0)
+ activerecord (~> 3.0.0)
+ activeresource (~> 3.0.0)
+ mocha (~> 0.9.8)
+ mysql (~> 2.8.1)
+ mysql2 (>= 0.3.6)
+ pg (~> 0.11)
+ rake
+ rspec (~> 2.6.0)
+ ruby-debug
+ ruby-debug19
+ sqlite3 (~> 1.3.3)
View
55 Rakefile
@@ -1,42 +1,25 @@
-require 'rake/rdoctask'
-require 'rspec/core/rake_task'
+begin
+ require 'rspec/core/rake_task'
+rescue LoadError
+ # no spec tasks
+else
+ task :default => :spec
-task :default => :spec
-
-desc 'Run ALL OF the specs'
-RSpec::Core::RakeTask.new(:spec) do |t|
- # t.ruby_opts = '-w'
-end
-
-namespace :spec do
- desc "Run Rails specs"
- RSpec::Core::RakeTask.new(:rails) do |t|
- t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
+ desc 'Run ALL OF the specs'
+ RSpec::Core::RakeTask.new(:spec) do |t|
+ # t.ruby_opts = '-w'
+ t.pattern = 'spec/finders/active_record_spec.rb' if ENV['DB'] and ENV['DB'] != 'sqlite3'
end
-end
-desc 'Generate RDoc documentation for the will_paginate plugin.'
-Rake::RDocTask.new(:rdoc) do |rdoc|
- rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc').
- include('lib/**/*.rb').
- exclude('lib/will_paginate/finders/active_record/named_scope*').
- exclude('lib/will_paginate/finders/sequel.rb').
- exclude('lib/will_paginate/view_helpers/merb.rb').
- exclude('lib/will_paginate/deprecation.rb').
- exclude('lib/will_paginate/core_ext.rb').
- exclude('lib/will_paginate/version.rb')
-
- rdoc.main = "README.rdoc" # page to start on
- rdoc.title = "will_paginate documentation"
-
- rdoc.rdoc_dir = 'doc' # rdoc output folder
- rdoc.options << '--inline-source' << '--charset=UTF-8'
- rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
+ namespace :spec do
+ desc "Run Rails specs"
+ RSpec::Core::RakeTask.new(:rails) do |t|
+ t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
+ end
+ end
end
-task :website do
- Dir.chdir('website') do
- %x(haml index.haml index.html)
- %x(sass pagination.sass pagination.css)
- 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'
end
View
20 spec/database.yml
@@ -3,20 +3,20 @@ sqlite3:
adapter: sqlite3
timeout: 500
-sqlite2:
- database: ":memory:"
- adapter: sqlite2
-
mysql:
adapter: mysql
- username: rails
- password: mislav
+ database: will_paginate
+ username:
+ encoding: utf8
+
+mysql2:
+ adapter: mysql2
+ database: will_paginate
+ username:
encoding: utf8
- database: will_paginate_unittest
postgres:
adapter: postgresql
- username: mislav
- password: mislav
- database: will_paginate_unittest
+ database: will_paginate
+ username: postgres
min_messages: warning
View
1 spec/finders/active_record_spec.rb
@@ -4,6 +4,7 @@
ActiverecordTestConnector.setup
WillPaginate::ActiveRecord.setup
+abort unless ActiverecordTestConnector.able_to_connect
describe WillPaginate::ActiveRecord do
View
1 spec/finders/data_mapper_test_connector.rb
@@ -1,3 +1,4 @@
+require 'sqlite3'
require 'dm-core'
require 'dm-core/support/logger'
require 'dm-migrations'

0 comments on commit 015d53a

Please sign in to comment.