Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

setup continuous integration testing with Travis-CI

  • Loading branch information...
commit 015d53a6d10def07f7c6f261ba414f47ce3671b8 1 parent 1fc2f10
Mislav Marohnić authored July 28, 2011
1  .rspec
... ...
@@ -0,0 +1 @@
  1
+--color
17  .travis.yml
... ...
@@ -0,0 +1,17 @@
  1
+rvm:
  2
+  - 1.8.7
  3
+  - 1.9.2
  4
+gemfile:
  5
+  - Gemfile
  6
+  - Gemfile.rails3.0
  7
+before_script:
  8
+  - "mysql -e 'create database will_paginate;'"
  9
+  - "psql  -c 'create database will_paginate;' -U postgres"
  10
+env:
  11
+  - DB=sqlite3
  12
+  - DB=mysql
  13
+  - DB=mysql2
  14
+  - DB=postgres
  15
+branches:
  16
+  only:
  17
+    - rails3
25  Gemfile
... ...
@@ -1,24 +1,29 @@
1  
-source :rubygems
  1
+source 'http://rubygems.org'
2 2
 
3  
-# path '/Users/mislav/.coral/rails-rails'
4  
-# git 'git://github.com/rails/rails.git'
  3
+rails_version = '~> 3.1.0.rc'
  4
+
  5
+gem 'activerecord',   rails_version
  6
+gem 'activeresource', rails_version
  7
+gem 'actionpack',     rails_version
5 8
 
6 9
 gem 'rake'
7  
-gem 'activerecord', '~> 3.1.0.rc'
8  
-gem 'activeresource', '~> 3.1.0.rc'
9  
-gem 'actionpack', '~> 3.1.0.rc'
10  
-gem 'sequel', '~> 3.8'
11 10
 gem 'rspec', '~> 2.6.0'
12 11
 gem 'mocha', '~> 0.9.8'
  12
+
  13
+gem 'sequel', '~> 3.8'
13 14
 gem 'sqlite3', '~> 1.3.3'
14 15
 gem 'dm-core'
15 16
 gem 'dm-aggregates'
16 17
 gem 'dm-migrations'
17 18
 gem 'dm-sqlite-adapter'
18  
-gem 'mysql', '~> 2.8.1', :group => :mysql
19  
-gem 'pg', '~> 0.8.0', :group => :pg
  19
+
  20
+group :mysql do
  21
+  gem 'mysql', '~> 2.8.1'
  22
+  gem 'mysql2', '>= 0.3.6'
  23
+end
  24
+gem 'pg', '~> 0.11', :group => :pg
20 25
 
21 26
 group :debug do
22 27
   gem 'ruby-debug', :platforms => :mri_18
23 28
   gem 'ruby-debug19', :platforms => :mri_19
24  
-end
  29
+end unless ENV['TRAVIS']
27  Gemfile.lock
@@ -32,7 +32,7 @@ GEM
32 32
     arel (2.1.4)
33 33
     bcrypt-ruby (2.1.4)
34 34
     builder (3.0.0)
35  
-    columnize (0.3.1)
  35
+    columnize (0.3.4)
36 36
     data_objects (0.10.6)
37 37
       addressable (~> 2.1)
38 38
     diff-lcs (1.1.2)
@@ -53,22 +53,24 @@ GEM
53 53
     erubis (2.7.0)
54 54
     hike (1.2.0)
55 55
     i18n (0.6.0)
56  
-    linecache (0.43)
  56
+    linecache (0.46)
  57
+      rbx-require-relative (> 0.0.4)
57 58
     linecache19 (0.5.12)
58 59
       ruby_core_source (>= 0.1.4)
59  
-    mocha (0.9.8)
60  
-      rake
  60
+    mocha (0.9.12)
61 61
     multi_json (1.0.3)
62 62
     mysql (2.8.1)
63  
-    pg (0.8.0)
  63
+    mysql2 (0.3.6)
  64
+    pg (0.11.0)
64 65
     rack (1.3.2)
65 66
     rack-cache (1.0.2)
66 67
       rack (>= 0.4)
67 68
     rack-mount (0.8.1)
68 69
       rack (>= 1.0.0)
69  
-    rack-test (0.6.0)
  70
+    rack-test (0.6.1)
70 71
       rack (>= 1.0)
71  
-    rake (0.8.7)
  72
+    rake (0.9.2)
  73
+    rbx-require-relative (0.0.5)
72 74
     rspec (2.6.0)
73 75
       rspec-core (~> 2.6.0)
74 76
       rspec-expectations (~> 2.6.0)
@@ -77,10 +79,10 @@ GEM
77 79
     rspec-expectations (2.6.0)
78 80
       diff-lcs (~> 1.1.2)
79 81
     rspec-mocks (2.6.0)
80  
-    ruby-debug (0.10.3)
  82
+    ruby-debug (0.10.4)
81 83
       columnize (>= 0.1)
82  
-      ruby-debug-base (~> 0.10.3.0)
83  
-    ruby-debug-base (0.10.3)
  84
+      ruby-debug-base (~> 0.10.4.0)
  85
+    ruby-debug-base (0.10.4)
84 86
       linecache (>= 0.3)
85 87
     ruby-debug-base19 (0.11.25)
86 88
       columnize (>= 0.3.1)
@@ -96,7 +98,7 @@ GEM
96 98
     sprockets (2.0.0.beta.12)
97 99
       hike (~> 1.2)
98 100
       rack (~> 1.0)
99  
-      tilt (~> 1.1, != 1.3.0)
  101
+      tilt (!= 1.3.0, ~> 1.1)
100 102
     sqlite3 (1.3.3)
101 103
     tilt (1.3.2)
102 104
     tzinfo (0.3.29)
@@ -114,7 +116,8 @@ DEPENDENCIES
114 116
   dm-sqlite-adapter
115 117
   mocha (~> 0.9.8)
116 118
   mysql (~> 2.8.1)
117  
-  pg (~> 0.8.0)
  119
+  mysql2 (>= 0.3.6)
  120
+  pg (~> 0.11)
118 121
   rake
119 122
   rspec (~> 2.6.0)
120 123
   ruby-debug
24  Gemfile.rails3.0
... ...
@@ -0,0 +1,24 @@
  1
+source 'http://rubygems.org'
  2
+
  3
+rails_version = '~> 3.0.0'
  4
+
  5
+gem 'activerecord',   rails_version
  6
+gem 'activeresource', rails_version
  7
+gem 'actionpack',     rails_version
  8
+
  9
+gem 'rake'
  10
+gem 'rspec', '~> 2.6.0'
  11
+gem 'mocha', '~> 0.9.8'
  12
+
  13
+gem 'sqlite3', '~> 1.3.3'
  14
+
  15
+group :mysql do
  16
+  gem 'mysql', '~> 2.8.1'
  17
+  gem 'mysql2', '>= 0.3.6'
  18
+end
  19
+gem 'pg', '~> 0.11', :group => :pg
  20
+
  21
+group :debug do
  22
+  gem 'ruby-debug', :platforms => :mri_18
  23
+  gem 'ruby-debug19', :platforms => :mri_19
  24
+end unless ENV['TRAVIS']
92  Gemfile.rails3.0.lock
... ...
@@ -0,0 +1,92 @@
  1
+GEM
  2
+  remote: http://rubygems.org/
  3
+  specs:
  4
+    abstract (1.0.0)
  5
+    actionpack (3.0.9)
  6
+      activemodel (= 3.0.9)
  7
+      activesupport (= 3.0.9)
  8
+      builder (~> 2.1.2)
  9
+      erubis (~> 2.6.6)
  10
+      i18n (~> 0.5.0)
  11
+      rack (~> 1.2.1)
  12
+      rack-mount (~> 0.6.14)
  13
+      rack-test (~> 0.5.7)
  14
+      tzinfo (~> 0.3.23)
  15
+    activemodel (3.0.9)
  16
+      activesupport (= 3.0.9)
  17
+      builder (~> 2.1.2)
  18
+      i18n (~> 0.5.0)
  19
+    activerecord (3.0.9)
  20
+      activemodel (= 3.0.9)
  21
+      activesupport (= 3.0.9)
  22
+      arel (~> 2.0.10)
  23
+      tzinfo (~> 0.3.23)
  24
+    activeresource (3.0.9)
  25
+      activemodel (= 3.0.9)
  26
+      activesupport (= 3.0.9)
  27
+    activesupport (3.0.9)
  28
+    archive-tar-minitar (0.5.2)
  29
+    arel (2.0.10)
  30
+    builder (2.1.2)
  31
+    columnize (0.3.4)
  32
+    diff-lcs (1.1.2)
  33
+    erubis (2.6.6)
  34
+      abstract (>= 1.0.0)
  35
+    i18n (0.5.0)
  36
+    linecache (0.46)
  37
+      rbx-require-relative (> 0.0.4)
  38
+    linecache19 (0.5.12)
  39
+      ruby_core_source (>= 0.1.4)
  40
+    mocha (0.9.12)
  41
+    mysql (2.8.1)
  42
+    mysql2 (0.3.6)
  43
+    pg (0.11.0)
  44
+    rack (1.2.3)
  45
+    rack-mount (0.6.14)
  46
+      rack (>= 1.0.0)
  47
+    rack-test (0.5.7)
  48
+      rack (>= 1.0)
  49
+    rake (0.9.2)
  50
+    rbx-require-relative (0.0.5)
  51
+    rspec (2.6.0)
  52
+      rspec-core (~> 2.6.0)
  53
+      rspec-expectations (~> 2.6.0)
  54
+      rspec-mocks (~> 2.6.0)
  55
+    rspec-core (2.6.4)
  56
+    rspec-expectations (2.6.0)
  57
+      diff-lcs (~> 1.1.2)
  58
+    rspec-mocks (2.6.0)
  59
+    ruby-debug (0.10.4)
  60
+      columnize (>= 0.1)
  61
+      ruby-debug-base (~> 0.10.4.0)
  62
+    ruby-debug-base (0.10.4)
  63
+      linecache (>= 0.3)
  64
+    ruby-debug-base19 (0.11.25)
  65
+      columnize (>= 0.3.1)
  66
+      linecache19 (>= 0.5.11)
  67
+      ruby_core_source (>= 0.1.4)
  68
+    ruby-debug19 (0.11.6)
  69
+      columnize (>= 0.3.1)
  70
+      linecache19 (>= 0.5.11)
  71
+      ruby-debug-base19 (>= 0.11.19)
  72
+    ruby_core_source (0.1.5)
  73
+      archive-tar-minitar (>= 0.5.2)
  74
+    sqlite3 (1.3.4)
  75
+    tzinfo (0.3.29)
  76
+
  77
+PLATFORMS
  78
+  ruby
  79
+
  80
+DEPENDENCIES
  81
+  actionpack (~> 3.0.0)
  82
+  activerecord (~> 3.0.0)
  83
+  activeresource (~> 3.0.0)
  84
+  mocha (~> 0.9.8)
  85
+  mysql (~> 2.8.1)
  86
+  mysql2 (>= 0.3.6)
  87
+  pg (~> 0.11)
  88
+  rake
  89
+  rspec (~> 2.6.0)
  90
+  ruby-debug
  91
+  ruby-debug19
  92
+  sqlite3 (~> 1.3.3)
55  Rakefile
... ...
@@ -1,42 +1,25 @@
1  
-require 'rake/rdoctask'
2  
-require 'rspec/core/rake_task'
  1
+begin
  2
+  require 'rspec/core/rake_task'
  3
+rescue LoadError
  4
+  # no spec tasks
  5
+else
  6
+  task :default => :spec
3 7
 
4  
-task :default => :spec
5  
-
6  
-desc 'Run ALL OF the specs'
7  
-RSpec::Core::RakeTask.new(:spec) do |t|
8  
-  # t.ruby_opts = '-w'
9  
-end
10  
-
11  
-namespace :spec do
12  
-  desc "Run Rails specs"
13  
-  RSpec::Core::RakeTask.new(:rails) do |t|
14  
-    t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
  8
+  desc 'Run ALL OF the specs'
  9
+  RSpec::Core::RakeTask.new(:spec) do |t|
  10
+    # t.ruby_opts = '-w'
  11
+    t.pattern = 'spec/finders/active_record_spec.rb' if ENV['DB'] and ENV['DB'] != 'sqlite3'
15 12
   end
16  
-end
17 13
 
18  
-desc 'Generate RDoc documentation for the will_paginate plugin.'
19  
-Rake::RDocTask.new(:rdoc) do |rdoc|
20  
-  rdoc.rdoc_files.include('README.rdoc', 'LICENSE', 'CHANGELOG.rdoc').
21  
-    include('lib/**/*.rb').
22  
-    exclude('lib/will_paginate/finders/active_record/named_scope*').
23  
-    exclude('lib/will_paginate/finders/sequel.rb').
24  
-    exclude('lib/will_paginate/view_helpers/merb.rb').
25  
-    exclude('lib/will_paginate/deprecation.rb').
26  
-    exclude('lib/will_paginate/core_ext.rb').
27  
-    exclude('lib/will_paginate/version.rb')
28  
-  
29  
-  rdoc.main = "README.rdoc" # page to start on
30  
-  rdoc.title = "will_paginate documentation"
31  
-  
32  
-  rdoc.rdoc_dir = 'doc' # rdoc output folder
33  
-  rdoc.options << '--inline-source' << '--charset=UTF-8'
34  
-  rdoc.options << '--webcvs=http://github.com/mislav/will_paginate/tree/master/'
  14
+  namespace :spec do
  15
+    desc "Run Rails specs"
  16
+    RSpec::Core::RakeTask.new(:rails) do |t|
  17
+      t.pattern = %w'spec/finders/active_record_spec.rb spec/view_helpers/action_view_spec.rb'
  18
+    end
  19
+  end
35 20
 end
36 21
 
37  
-task :website do
38  
-  Dir.chdir('website') do
39  
-    %x(haml index.haml index.html)
40  
-    %x(sass pagination.sass pagination.css)
41  
-  end
  22
+desc 'Run specs against both Rails 3.1 and Rails 3.0'
  23
+task :rails3 do |variable|
  24
+  system 'bundle exec rake spec && BUNDLE_GEMFILE=Gemfile.rails3.0 bundle exec rake spec:rails'
42 25
 end
20  spec/database.yml
@@ -3,20 +3,20 @@ sqlite3:
3 3
   adapter: sqlite3
4 4
   timeout: 500
5 5
 
6  
-sqlite2:
7  
-  database: ":memory:"
8  
-  adapter: sqlite2
9  
-
10 6
 mysql:
11 7
   adapter: mysql
12  
-  username: rails
13  
-  password: mislav
  8
+  database: will_paginate
  9
+  username: 
  10
+  encoding: utf8
  11
+
  12
+mysql2:
  13
+  adapter: mysql2
  14
+  database: will_paginate
  15
+  username: 
14 16
   encoding: utf8
15  
-  database: will_paginate_unittest
16 17
 
17 18
 postgres:
18 19
   adapter: postgresql
19  
-  username: mislav
20  
-  password: mislav
21  
-  database: will_paginate_unittest
  20
+  database: will_paginate
  21
+  username: postgres
22 22
   min_messages: warning
1  spec/finders/active_record_spec.rb
@@ -4,6 +4,7 @@
4 4
 ActiverecordTestConnector.setup
5 5
 
6 6
 WillPaginate::ActiveRecord.setup
  7
+abort unless ActiverecordTestConnector.able_to_connect
7 8
 
8 9
 describe WillPaginate::ActiveRecord do
9 10
   
1  spec/finders/data_mapper_test_connector.rb
... ...
@@ -1,3 +1,4 @@
  1
+require 'sqlite3'
1 2
 require 'dm-core'
2 3
 require 'dm-core/support/logger'
3 4
 require 'dm-migrations'

0 notes on commit 015d53a

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